We will start with an empty application and insert the code for our quad into the createScene()
function:
Begin with creating the manual object:
Ogre::ManualObject* manual = mSceneMgr->createManualObject("Quad"); manual->begin("BaseWhiteNoLighting", RenderOperation::OT_TRIANGLE_LIST);
Create four points for our quad:
manual->position(5.0, 0.0, 0.0); manual->textureCoord(0,1); manual->position(-5.0, 10.0, 0.0); manual->textureCoord(1,0); manual->position(-5.0, 0.0, 0.0); manual->textureCoord(1,1); manual->position(5.0, 10.0, 0.0);manual->textureCoord(0,0);
Use indices to describe the quad:
manual->index(0); manual->index(1); manual->index(2); manual->index(0); manual->index(3); manual->index(1);
Finish the manual object and convert it to a mesh:
manual->end(); manual->convertToMesh("Quad");
Create an instance of the entity and attach it to the scene using a scene node:
Ogre::Entity * ent = mSceneMgr-...