Operating System:Windows 10
In my project I want users to be able to choose a team color. Their models should then be colored with their team color. I did this with the robot mesh that comes with Ogre by manually creating a second texture and material where the grey is colored red or blue. However I want the user to be able to choose any color with a color picker and manually creating every color for every model these seems incorrect.
Code: Select all
mEntity->setMaterialName("Examples/Robot"); MaterialPtr mMat = mEntity->getSubEntity(0)->getMaterial(); mMat->getTechnique(0)->getPass(0)->setAmbient(255, 0, 0); mMat->getTechnique(0)->getPass(0)->setDiffuse(255, 0, 0, 0); mEntity->setMaterialName(mMat->getName());
I was going to texture all my models grey where I want a team color. Then at run time pick a color and change all the grey color in my texture to the selected color. Can Ogre do this?