This lab is only losely based on Chapter 6 on resource management in the text book. The focus here is on being able to create a new resource (a 3d model) and bringing it into an Ogre 3D scene.
Discussion thread for this lab is here: Lab 3 Discussion Thread
The primary goal with this lab is to go through the process of creating an original external resource (a 3D model in Blender) and bringing it “unharmed” into an Ogre 3D scene. The secondary goal is to gain familiarity with the Ogre 3D “mesh” and “material” file formats.
You need to do the following to set up the right tools:
Follow these steps to complete the lab project:
Set as StartUp Project
Debug
folder) and create a sub-folder called Models
. In order for this folder to be found by your Ogre application, you need to add it to the list of FileSystems in your application's resources_d.cfg
file. You can use a relative path (e.g. FileSystem=Models
). createScene
method in your application, you should now create a new Entity that gets associated with the model resource you just created. Make sure that your code makes this new Entity visible in the scene by attaching it to the scene graph.Ogre::Entity* mycube = _sceneManager->createEntity("MyCube", "MyCubeMesh.mesh"); Ogre::SceneNode* cubeNode = _sceneManager->getRootSceneNode()->createChildSceneNode(); cubeNode->attachObject(mycube); cubeNode->setScale(50,10,50); // You may have to scale your object to see it well\\
_sceneManager→createEntity(“MyCube2”, “MyCubeMesh.mesh”);
method. The resource manager is clever enough not to load the model twice from disk. Create a new material inside the same material file you looked at earlier, by copy-pasting the material definition within the same file and changing its name (e.g. into BlueMaterial) and give it different values (e.g. making the diffuse color blue). Aassign the new material to a new entity in your Ogre application with the setMaterialName method like this: myCube->setMaterialName("BlueMaterial");
Upload your commented source files into Lab3 in MySchool (zip them up if more than one). The lab projects will not be graded, but their completion counts towards your participation grade.