ManualObject* lManualObject;
lManualObject=mSceneMgr->createManualObject("mo");
lManualObject->begin("BaseWhiteNoLighting");
Ogre::Real cm = -5.0 ;
Ogre::Real cp = 5.0;
lManualObject->position(cm, cp, cm);// a vertex
lManualObject->colour(Ogre::ColourValue(0.0f,1.0f,0.0f,1.0f));
lManualObject->position(cp, cp, cm);// a vertex
lManualObject->colour(Ogre::ColourValue(1.0f,1.0f,0.0f,1.0f));
lManualObject->position(cp, cm, cm);// a vertex
lManualObject->colour(Ogre::ColourValue(1.0f,0.0f,0.0f,1.0f));
lManualObject->position(cm, cm, cm);// a vertex
lManualObject->colour(Ogre::ColourValue(0.0f,0.0f,0.0f,1.0f));
lManualObject->position(cm, cp, cp);// a vertex
lManualObject->colour(Ogre::ColourValue(0.0f,1.0f,1.0f,1.0f));
lManualObject->position(cp, cp, cp);// a vertex
lManualObject->colour(Ogre::ColourValue(1.0f,1.0f,1.0f,1.0f));
lManualObject->position(cp, cm, cp);// a vertex
lManualObject->colour(Ogre::ColourValue(1.0f,0.0f,1.0f,1.0f));
lManualObject->position(cm, cm, cp);// a vertex
lManualObject->colour(Ogre::ColourValue(0.0f,0.0f,1.0f,1.0f));
// face behind / front
lManualObject->triangle(0,1,2);
lManualObject->triangle(2,3,0);
lManualObject->triangle(4,6,5);
lManualObject->triangle(6,4,7);
// face top / down
lManualObject->triangle(0,4,5);
lManualObject->triangle(5,1,0);
lManualObject->triangle(2,6,7);
lManualObject->triangle(7,3,2);
// face left / right
lManualObject->triangle(0,7,4);
lManualObject->triangle(7,0,3);
lManualObject->triangle(1,5,6);
lManualObject->triangle(6,2,1);
lManualObject->end();
Ogre::String lNameOfTheMesh = "MeshCubeAndAxe";
lManualObject->convertToMesh(lNameOfTheMesh);
Entity* entity = mSceneMgr->createEntity(lNameOfTheMesh);
mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(entity);