This sample shows the use of a Point Light using the PointLight sample material.
Click on the image to download the sample.
| 
|
When you install this package, a Torus, floor Grid, and a Point Light will be added to the scene. The light properties are connected to the PointLight sample material via the logic diagram called LightToMaterial. This diagram connects the position and color properties from the light to the PointLight material used to render the sphere.
You also may have notices it connect the value from the LightIntensity slider to the DiffuseIntesity and SpecularIntensity properties on the PointLightMaterial, with a scaler. This means you can quickly control the lights intensity using the GUI slider in the upper right corner of the screen.Also Try changing the color properties of the light.
The light is slowly circling the Torus. It does thos with a script on its OnUpdate event:
Vector3 pos = Vector3.One;float speed = (float)context.SceneTime * 0.4f;; pos.X = (float) Math.Sin(speed);
pos.Z = (float) Math.Cos(speed);
pos *= 7;
context.Spatial.LocalPosition = pos;
It starts with a positions of 1, 1, 1. It then obtains a speed using the time delta (between updates), and uses it with a sine and cosine to generate a world x and z position, leaving y at 1. This forms a circle, which is then scaled up. Finally the positions is set be is the LocalPosition.