Point LightThis is a featured page


This sample shows the use of a Point Light using the PointLight sample material.
PointLight.xpkg

Click on the image to download the sample.

Point Light - Blade3D

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.

Point Light - Blade3D

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.


X-Tatic
X-Tatic
Latest page update: made by X-Tatic , Jun 2 2007, 3:14 PM EDT (about this update About This Update X-Tatic Edited by X-Tatic


view changes

- complete history)
Keyword tags: None
More Info: links to this page
There are no threads for this page.  Be the first to start a new thread.