Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi niko, I'm trying to add lights to my scene. Creating a LightSceneNode without a LightData object like this:
Creates a light, but the Pos is always 0,0,0. The CL3D.Light documentation also has a Position member (not sure how this differs from the parent SceneNode Pos member). Attempting to add a LightData to the LightSceneNode like this:
Causes no light to be cast in the scene at all! I've tried also setting the Color and Attenuation of ldata, but all I seem to get is darkness. How can I create a light at some point other than 0,0,0? I'm using Copperlicht 1.6.1. Thanks, |
||||
|
Hi, to change the position of the light, you only need to change the position of the light scene node, just like with all other scene node types, so that was right. The problem is maybe how you set the position. Is your 'pos' variable maybe null, or undefined or similar? You can test with alert(pos.toString()), for example. Also, maybe you are setting the position correctly, but since you are not copying it, maybe you are modifying the position afterwards again, so a safe way to set the position would be to use scenenode.Pos = pos.clone(); Maybe this helps. |
|