LightFixed Class
.NET Framework 3.0
Represents a set of lighting properties. This class cannot be inherited.
Namespace: Microsoft.WindowsMobile.DirectX.Direct3D
Assembly: Microsoft.WindowsMobile.DirectX (in microsoft.windowsmobile.directx.dll)
Microsoft.WindowsMobile.DirectX.Direct3D Namespace
Assembly: Microsoft.WindowsMobile.DirectX (in microsoft.windowsmobile.directx.dll)
The following code example shows how to use LightFixed structures.
// This code example is from the // Direct3D Mobile Fixed Point Lighting Sample // of the .NET Compact Framework Samples in the SDK. // The FrameMove method is called once per frame, // and is the entry point for animating the scene. public void FrameMove() { lightData = device.LightsFixed[2]; // Rotate through the various light types if (((int)appTime % 20) < 10) device.LightsFixed[2].Type = LightType.Point; else device.LightsFixed[2].Type = LightType.Directional; // Make sure the light type is supported by the device. If // VertexProcessingCaps.PositionAllLights is not set, the // device does not support point or spot lights, so change // light #2's type to a directional light. if (!device.DeviceCaps.VertexProcessingCaps.SupportsPositionalLights) { if (device.LightsFixed[2].Type == LightType.Point) device.LightsFixed[2].Type = LightType.Directional; } // Values for the light position, direction, and color float x = (float)Math.Sin(appTime*2.000f); float y = (float)Math.Sin(appTime*2.246f); float z = (float)Math.Sin(appTime*2.640f); byte r = (byte)((0.5f + 0.5f * x) * 0xff); byte g = (byte)((0.5f + 0.5f * y) * 0xff); byte b = (byte)((0.5f + 0.5f * z) * 0xff); device.LightsFixed[2].DiffuseColor = ColorValueFixed.FromColor(System.Drawing.Color.FromArgb(r, g, b)); device.LightsFixed[2].Range = 100.0f; switch(device.LightsFixed[2].Type) { case LightType.Point: device.LightsFixed[2].Position = new Vector3Fixed(4.5f * x, 4.5f * y, 4.5f * z); device.LightsFixed[2].Attenuation1 = 0.4f; break; case LightType.Directional: device.LightsFixed[2].Direction = new Vector3Fixed(x, y, z); break; } device.LightsFixed[2].Update(); }
System.Object
Microsoft.WindowsMobile.DirectX.Direct3D.BaseMesh
Microsoft.WindowsMobile.DirectX.Direct3D.LightFixed
Microsoft.WindowsMobile.DirectX.Direct3D.BaseMesh
Microsoft.WindowsMobile.DirectX.Direct3D.LightFixed
Reference
LightFixed MembersMicrosoft.WindowsMobile.DirectX.Direct3D Namespace
Other Resources
Direct3D ProgrammingCommunity Additions
ADD
Show: