[solved] Node color

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
akaz
Posts: 9
Joined: Sun Nov 01, 2009 7:52 pm

[solved] Node color

Post 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
Last edited by akaz on Tue May 11, 2010 11:43 pm, edited 1 time in total.
slavik262
Posts: 753
Joined: Sun Nov 22, 2009 9:25 pm
Location: Wisconsin, USA

Post 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.
akaz
Posts: 9
Joined: Sun Nov 01, 2009 7:52 pm

Post 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));

Post Reply