Time for action — creating a model for displaying blades of grass
This time, we want to use the OctreeSceneManager
, so we don't need the chooseSceneManager()
function:
- We need an empty application:
class Example43 : public ExampleApplication { private: public: void createScene() { } };
- The first thing we need in the
createScene()
function is a plane definition. We will use the plane as our ground for blades of grass:Ogre::Plane plane(Vector3::UNIT_Y, -10); Ogre::MeshManager::getSingleton().createPlane("plane", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, plane, 1500,1500,200,200,true,1,5,5,Vector3::UNIT_Z);
- Then instantiate the newly created plane and set a material. We will use the
GrassFloor
material from the examples:Ogre::Entity* ent = ...
Get Ogre 3D 1.7 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.