Hi I'm trying to set the emissive color of cube:
IMeshSceneNode* node = smgr->addCubeSceneNode();
SMaterial mat = node->getMaterial(0);
mat.EmissiveColor.set(1,1,0,0);
but once I've done this I must do something like node.setMaterial(mat) ?
I come from Java. SMaterial mat = node->getMaterial(0); means that I don't get a pointer to the object but a new object so every change I make to this object (ex mat.EmissiveColor.set(1,1,0,0)) doesn't affect the material of the cube. This is right?
Thanks
[SOLVED]Newbie irrlicht question: how to set a material col.
[SOLVED]Newbie irrlicht question: how to set a material col.
Last edited by Tranen on Tue Feb 23, 2010 2:11 pm, edited 1 time in total.
Sorrry, but i can't apply the material to my cube with cube.setMaterial(mat);Tranen wrote:Thanks
Cheers
Tranen
My code is:
ISceneNode* cube = smgr->addCubeSceneNode( );
cube->setPosition(vector3df(0,0,100));
SMaterial& mat = cube->getMaterial(0);
mat.EmissiveColor.set(1,1,0,0);
cube.setMaterial(mat);
To share is great! Thanks.