ambient light color...

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
cmoibenlepro
Posts: 237
Joined: Thu May 27, 2004 3:18 pm
Location: Canada

ambient light color...

Post by cmoibenlepro »

I wanted to use an ambient light but I have some problems..

in the documentation it says:
color: Diffuse color of the light. Ambient or Specular colors can be set manually with the ILightSceneNode::getLightData() method.
But I don't understand how to set the ambient color with getLightData() ...
I've tried many things, but it don't compile.

Does Ambient lights are implemented?
BTW why does we use getLightData to set the color? Why not setLightData?

anyway here is my code:

Code: Select all

scene::ISceneNode* lumiere = smgr->addLightSceneNode(0,core::vector3df(0,0,0), SColorf(0.0f, 0.0f, 0.0f, 1.0f) , 600.0f);
	
	SLight amb = lumiere.getLightData();
	amb.AmbientColor = SColorf(1.0f, 0.5f, 0.0f, 1.0f);
It does not even compile.
what can I do?
thanks for any help. :)
WalterWzK
Posts: 72
Joined: Wed Jan 12, 2005 2:57 pm
Location: Netherlands
Contact:

Post by WalterWzK »

Dunno mate, it seems to me that this is unlikly the right way since the getLightData function is a 'Protected Function' as mentioned in the API Documentation
Current Project: Don Salvatore's Mafia
Genre: 3D Shooter \ RTS
Programming Language: VB .NET
Engine: Irrlicht 11 [.NET Wrapper]
Guest

Post by Guest »

Haven't looked into it but

ISceneNode* lumiere = probably should be

ILightSceneNode* lumiere =

and

lumiere.getLightData();

to

lumiere->getLightData();

Haven't looked at slight don't know about that.
WalterWzK
Posts: 72
Joined: Wed Jan 12, 2005 2:57 pm
Location: Netherlands
Contact:

Post by WalterWzK »

Yeah well it looks like he isnt really copying ans pasting the code.. cuz he is mixing to different styles of programming (C and VB) but the general idea is good. But the:

'ISceneNode* lumiere =' probably should be 'ILightSceneNode* lumiere = '

is right, I did not notice that but it is indeed required.
Current Project: Don Salvatore's Mafia
Genre: 3D Shooter \ RTS
Programming Language: VB .NET
Engine: Irrlicht 11 [.NET Wrapper]
Post Reply