Table of Contents

LAB1: Ogre Startup Sequence

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, which will be given to you as a hand-out at the beginning of the lab class. But before you can start on the steps in the chapter, you will need to properly set up your development environment, this is covered below.

Discussion

Discussion thread for this lab (with updated notes) is here: Lab 1 Discussion Thread

Preparation

If you are using your own computer, you need to:

  1. Download and install C++ development environment, the instructions will assume you are using the MS Visual C++ Express 2010 environment, which you can get for free. You're free to use other environments or platforms as long as you take care of making it work (with the help of the Internet).
  2. Download and install OGRE 1.8.1 SDK for Visual C++ .Net 2010 (32-bit). I recommend extracting this to a folder with a relatively short path and no spaces. E.g. into “C:\Development”.

To prepare your environment and project you need to:

  1. Create a system environment variable OGRE_HOME that points to Ogre SDK folder. You can then refer to this variable in your project setup as $(OGRE_HOME). This is so that you can easily take your project to a different machine where Ogre might be installed in a different folder. If each machine defines this variable, the project should be able to find the needed includes and libraries (see below).
  2. The Ogre run-time libraries (DLLs) are in folders called bin/debug and bin/release inside the SDK folder. You need to add these two folders to your system path variable so that the system can find them when you launch your application.
  3. It is good to organize all your lab source code from the very beginning of this class to avoid a complete mess later. VC++ helps you organize the code into solutions and projects. A solution is really a collection of projects, which is a great way to keep track of labs. Once you launch VC++, create a new project called “Lab1” inside a new solution called “GEDE2013” (it is a good idea to let VC++ create a folder for your solution - use the check box - and then your projects will appear inside that folder). The project should be a WIN32 Console Application and completely empty. You will write it from scratch.
  4. Right-click on your project inside VC++ and choose properties. Add Ogre folders and files in several locations within the properties:
    • C/C++→General→Additional Include Directories = $(OGRE_HOME)\include\OIS;$(OGRE_HOME)\include\OGRE;$(OGRE_HOME)\include;$(OGRE_HOME)\boost;%(AdditionalIncludeDirectories)
    • Linker→Input→Additional Dependencies = OgreMain_d.lib;OIS_d.lib;%(AdditionalDependencies)
    • Linker→General→Additional Library Directories = $(OGRE_HOME)\boost\lib;$(OGRE_HOME)\lib\debug;%(AdditionalLibraryDirectories)
  5. Copy plugins_d.cfg and resources_d.cfg from the SDK bin/debug folder into your own GEDE2013/debug (or wherever your own compiled executables will be placed)

Lab Project

Work through the enumerated actions in the hand-out given to you:

  1. “Starting Ogre 3D”
  2. “Loading the Sinbad mesh”
  3. “Using resources.cfg to load our models”
  4. “Creating a class”
  5. “Adding a FrameListener”
  6. “Adding input”
  7. “Using our own rendering loop”
  8. “Adding a frame listener - Camera”
  9. “Adding a plane and a light”
  10. “Controlling the model with the arrow keys” (OPTIONAL)
  11. “Adding animation” (OPTIONAL)

When You Are Finished

Upload your commented source files into Lab1 in MySchool (zip them up if more than one). The lab projects will not be graded, but their completion counts towards your participation grade.