Jin
16-05-2006 15:09:27
I've created a simple scene with a particle fountain, 2 boxes, and a light. the second box is supposed to cast a shadow onto the first box, but the light will not appear. This is using ODN 1.2 Final.
The problem is that the light will not show up, it said that by default the light should illuminate about 1000 world units, but it is not there. Also, how do you set the range of the light? Maybe it's just something I'm doing wrong in the code, I don't know.
protected override void CreateScene()
{
mSceneManager.SetAmbientLight(Color.FromArgb(16, 16, 16));
mSceneManager.ShadowTechnique = ShadowTechnique.ShadowTypeStencilAdditive;
SceneNode pnode = mSceneManager.CreateSceneNode("PSystemNode");
pnode.Position = new Vector3(0, 50, 0);
mSceneManager.GetRootSceneNode().AddChild(pnode);
ParticleSystem psystem = mSceneManager.CreateParticleSystem("PSystem1", "Examples/PurpleFountain");
pnode.AttachObject(psystem);
Entity box = mSceneManager.CreateEntity("Box1", "cube.mesh");
mSceneManager.GetRootSceneNode().CreateChildSceneNode().AttachObject(box);
box.MaterialName = "Examples/Rockwall";
Entity box2 = mSceneManager.CreateEntity("Box2", "cube.mesh");
box2.CastShadows = true;
mSceneManager.GetRootSceneNode().CreateChildSceneNode(new Vector3(-200, 50, 0)).AttachObject(box2);
box2.MaterialName = "Examples/Rockwall";
Light light = mSceneManager.CreateLight("Light1");
light.Type = Light.LightTypes.Point;
light.Position = new Vector3(0, 75, 0);
light.DiffuseColor = Color.White;
light.SpecularColour = Color.White;
}
The problem is that the light will not show up, it said that by default the light should illuminate about 1000 world units, but it is not there. Also, how do you set the range of the light? Maybe it's just something I'm doing wrong in the code, I don't know.