Today we will go a little bit deeper into the Ogre framework, and create an interactive scene, where we can navigate around, add a ground and explore the use of keyboard and Mouse input.
For this lab we will break down the application made in Lab1 into a class definition. We will look at the rendering loop and create a listener class that will handle the per-frame updates, as well as listening for user input. This lab is based on chapter 9 “The Ogre 3D Startup Sequence” from the book “Ogre 3D 1.7 - Beginner's Guide” by Felix Kerger.
At the end of this lab, we will have a similar scene as in Lab1 but we will be able to interact with the scene. This lab will include Some bonus points, and we encourage you to do them.
While the Lab Assignment is a little hard boiled, feel free and I encourage you to experiment, change the code structure (its quite ugly in the guide :) and or add functionality. Just make sure your application qualifies to the standard requirements of the Lab :)
This is somewhat our goal.
Discussion thread for this lab will be on Piazza: Lab 2 Discussion Thread. Please don't hesitate to ask questions or comment on the Lab assignment.
You need to create a new project, and configure it like we did in the first lab.You have three options:
Creating a project template →
Copying VS configurations the crude way →
<project name>.vcxproj
with a text editor and change the following. (Make sure you save the solution and close visual studio prior to this step)<RootNamespace>"previous project name"</RootNamespace> to <RootNamespace>"new project name"</RootNamespace>
Work through the enumerated actions in the Beginners Guide ( Don't worry, after this lab we will no longer use this guide ).
Bonus Pts
// Print out all available animation names for _SinbadEnt. Ogre::AnimationStateIterator iter = _SinbadEnt->getAllAnimationStates()->getAnimationStateIterator(); while (iter.hasMoreElements()) { Ogre::AnimationState *a = iter.getNext(); std::cout << a->getAnimationName() << std::endl; }
You should be able to navigate the camera around Sinbad, and you should also see the plane under Sinbad receiving his shadow.
If you were a good citizen and implemented the Bonus points in the guide, you should also be able to move Sinbad with very lame controls (We will address this in a later Lab :) ), and see him animated while walking.
Upload your briefly commented (if appropriate) source files, ONLY .cpp and .h no project related thanks! into Lab2 in MySchool (zip them up if more than one). The lab projects will not be graded, but their completion counts towards your participation grade.