Material Colours?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
cooljayman
Posts: 22
Joined: Wed Mar 05, 2008 8:25 am

Material Colours?

Post by cooljayman »

Simple question. What is the exact syntax to change a materials colors like ambient, diffuse, specular ect.? Tried this

Code: Select all

node->setMaterialFlag(video::SMaterial::AmbientColor, false);
but this does not allow me to pass color information??
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

node->getMaterial(i).DiffuseColor = video::SColor(a,r,g,b);

where i is the material index you wish to affect (probably just 0) and a,r,g,b is the colour you want the diffuse colour to be set to (i think that's the correct order for the colour).
Image Image Image
Post Reply