Changing Colour of a static mesh

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
hkolli
Posts: 42
Joined: Thu Jul 13, 2006 8:29 pm

Changing Colour of a static mesh

Post 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
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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.
Mutter
Posts: 11
Joined: Mon Jul 10, 2006 6:05 pm

similar problem here

Post 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?
und wieder ein deutscher :)
Gatekeeper
Posts: 31
Joined: Fri Apr 21, 2006 12:00 am
Location: Australia

Post 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.
Post Reply