I'm having some trouble changing the colour of an individual mesh with the mesh manipulator.
What happens is that I have two seperate objects tied to two seperate meshes; where both meshes are loaded from the same file.
Essentially they have the same mesh, but I'm assigning them to different variables. When I change the colours of one of the meshes, the other one - which should be unrelated to the other - also changes its colour.
Example:
object_1:
Code: Select all
IMesh* m_Mesh = m_Smgr->getMesh("Media//mesh.x");
IMeshSceneNode* m_Node...etc
Code: Select all
IMesh* m_Mesh = m_Smgr->getMesh("Media//mesh.x");
IMeshSceneNode* m_Node...etc
Code: Select all
Object object_1;
Object object_2;
smgr->getMeshManipulator()->setVertexColors([b]object_1[/b].m_Node->getMesh(), SColor(0, rand() % 255, rand() % 255, rand() % 255));
This also happens when referring to the mesh directly, instead of using 'm_Node->getMesh().'
I've also tried setting the mesh again with 'm_Node->setMesh()' after changing the colour, but this does not work either.
This isn't completely illogical, it's just that I want to know how to make irrlicht think the mesh is a seperate one.
Since there's lots of different files I'm dealing with, I can't just make copies of the file for each individual mesh / colour combination.
Thanks in advance,
Sjors