How to change color of sphere from addSphereSceneNode()
How to change color of sphere from addSphereSceneNode()
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?
Re: How to change color of sphere from addSphereSceneNode()
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
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()
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.
Re: How to change color of sphere from addSphereSceneNode()
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!