Page 1 of 1

[solved] Node color

Posted: Tue May 11, 2010 9:42 pm
by akaz
Hello,
I am creating new scene node (addSphereSceneNode()) and trying to set custom color of its render, but I don't know how I can made that.
I can create texture file with desired color (then setMaterialTexture()), but it's not too much elegant option, also, I need to change many times color of node while scene rendering.
I have tried to find something on this forum, google and documentation, but can't find anything that would answer to my problem.

I will be very thankful for any help!
Adam

Posted: Tue May 11, 2010 10:07 pm
by slavik262
You'll want to change the color of the vertices. Check out the MeshManipulator from IVideoDriver::getMeshManipulator (IIRC). It has a function that will do that for you.

Posted: Tue May 11, 2010 11:41 pm
by akaz
Thank you for fast reply, slavik262!
Your post helped me a lot!

There is code snippet for people who find this thread having same problem:

Code: Select all

	scene::IMesh *mesh = smgr->addSphereMesh("mesh");
	scene::IMeshSceneNode* node = smgr->addMeshSceneNode( mesh );
	smgr->getMeshManipulator()->setVertexColors(mesh, video::SColor(255,150,75,20));