Page 1 of 1

Changing Colour of a static mesh

Posted: Tue Jul 25, 2006 7:34 pm
by hkolli
hi all ,

the following is a part of my code .....

scene::IAnimatedMesh* mesh = smgr->getMesh(
"../../media/bird.x");
scene::IAnimatedMeshSceneNode* anode = 0;
anode = smgr->addAnimatedMeshSceneNode(mesh);


I need to change the colour of this static mesh which is in .X format . Is there any way i can change its colour .please help me :(
thanks
haritha

Posted: Tue Jul 25, 2006 7:58 pm
by hybrid
What about MeshManipulator->setVertexColor? Or iterate through the mesh buffers and do it on your own - with more possibilities to adjust colors during the traversal.

similar problem here

Posted: Sun Jul 30, 2006 4:52 pm
by Mutter
i want to "highlight" an object when my mouse is over it...
i use parallax mapped object.

when i use lighting = false, it stays lightened.
when i use setvertexcolor with the meshmanipulator
nothing changes.
when i use getmaterial->DiffuseColor.set(...)
nothing changes. same with ambientcolor, shininess.

what is the solution to make an object for ex. bright which is
parallax mapped?

Posted: Mon Jul 31, 2006 3:58 am
by Gatekeeper
I did something similar in a very easy way...

I made a texture that was a 32x32 png file that had an alpha channel in it (i.e. blue and 50% transparent).

Then, when the mouse was over the node, I simply added this texture as the 2nd texture to the node. When the mouse was over a new node, I just set the 2nd texture of the node to NULL.

With this the whole node turns a colour, but you can still see the textures beneath.