Page 1 of 1

Lighting Problem

Posted: Thu Jul 12, 2007 12:33 pm
by ansu832001
Hi ALL,

Iam Getting this ligthing problem which iam unable to understand.Actually iam creating a Node with RED color and a light with Green Color.Whenever iam enabling light to my Node my Node color is getting effected because of light color.Any Idea??

the below is the code iam using


///My SceneNode with Red color
SceneNode node = device.SceneManager.AddCubeSceneNode(15, null, -1);
node.Position = new Vector3D(0,10,0);
Material mat = node.GetMaterial(0);
mat.DiffuseColor = Color.Red;//new IrrlichtNETCP.Color(100, 230, 130, 150);
mat.EmissiveColor = Color.Red;
mat.AmbientColor = Color.Red;
mat.Lighting = true ;


///Creating Directional Light with Green Color

lightNode = device.SceneManager.AddLightSceneNode(null, new Vector3D(0, 0, 0), new Colorf(0.5f, 1.0f, 0.5f, 0.0f), 200.0f, -1);
light = new Light();
light.Type = LightType.Directional;
light.DiffuseColor = Colorf.Green;
light.AmbientColor = Colorf.Green;
light.SpecularColor = Colorf.Green;
light.Radius = 1000.0f;
// Create a direction for our light - it must be normalized
Vecto3D vecDir = new Vector3D(100.0f, 500.0f, 0.0f);
vecDir.Normalize();
light.Position = vecDir;
lightNode.LightData = light;

Need Help.
Best Regards,