How to change color of sphere from addSphereSceneNode()

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
pwnstar23
Posts: 4
Joined: Tue Oct 02, 2012 5:27 pm

How to change color of sphere from addSphereSceneNode()

Post by pwnstar23 »

I have a lot of spheres I made this way, each object I make stores the node. I set the material ambient, specular, and diffuse colors to any other color, the spheres are still always drawn white? How to change the color?
CuteAlien
Admin
Posts: 10054
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: How to change color of sphere from addSphereSceneNode()

Post by CuteAlien »

You can experiment with color-settings in "Example 22 - Material Viewer". But you probably want setVertexColors from IMeshManipulator (you get that from the scenemanager).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hybrid
Admin
Posts: 14144
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: How to change color of sphere from addSphereSceneNode()

Post by hybrid »

If you want to use the light materials, you have to enable lighting and create a light source. When using the vertex color change, you change all scene nodes which use the same mesh. Pnly light material values are stored per scene node.
pwnstar23
Posts: 4
Joined: Tue Oct 02, 2012 5:27 pm

Re: How to change color of sphere from addSphereSceneNode()

Post by pwnstar23 »

I set lighting to true, and then set ambient light to white and then my nodes are the color I set the material, thanks for the replies!
Post Reply