I want to set a color to a node like Java API 3d does.
Node->setAmbientColor(255,255,255);
How is in irrlicht ?
simple color question !
In irrlicht, a node can consist of several different materials, which have individual light/color properties.
You can get the number of materials of a node by calling Node->getMaterialCount().
Then you can retrieve the materials from the node and set the property AmbientColor. I recomend checking trough SMaterial.h in the include-folder.
You also need to set the general ambient world light color. You do so by calling SceneManager->setAmbientLight(...)
You can get the number of materials of a node by calling Node->getMaterialCount().
Then you can retrieve the materials from the node and set the property AmbientColor. I recomend checking trough SMaterial.h in the include-folder.
You also need to set the general ambient world light color. You do so by calling SceneManager->setAmbientLight(...)
Code: Select all
Node->getMaterial(0).AmbientColor=SColor(0,255,0,0); //Set first materials ambient property
SceneManager->setAmbientLight(SColor(128, 128, 128, 128)); //Set ambient light color
If you don't have anything nice to say, don't say anything at all.