OGRE 3D 1.7 Beginner's Guide - Kerger Felix - E-Book

OGRE 3D 1.7 Beginner's Guide E-Book

Kerger Felix

0,0
34,79 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Want to make your own 3D applications, simulations, and games?

OGRE 3D, an open source Object-Oriented 3D Graphics Rendering Engine written in C++, which can be utilized to create a variety of 3D applications and is commonly used in game creation, can help you to do so!

OGRE 3D 1.7 Beginner's Guide, based on the latest version 1.7, makes it super easy for you to make your own monsters, spaceship shooters, weapons, enemies, and more!OGRE 3D 1.7 Beginner's Guide will teach you to develop 3D applications that are exciting and interesting and if used correctly can result in stunning games and simulations. You will start from the very beginning and then work your way up to complex scenes and stunning effects.In this book you will start with how to download and configure OGRE 3D, then create your first example scene. With the help of this sample scene, you will be introduced to several related topics each of which will be explained through several other examples and by do-it-yourself tasks.

After each example there is a section that explains the theory behind the technique used for deeper understanding. You will also use what you learned in one example in another example and repeat each technique several times while learning new ones at the same time to strengthen the topics learned. Within no time you will master the art of game creation. Imagine how great you will feel when all your friends are playing the great-looking games you've created with OGRE 3D and this book.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB

Seitenzahl: 273

Veröffentlichungsjahr: 2010

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

Ogre 3D 1.7
Credits
About the Author
About the Reviewers
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Errata
Piracy
Questions
1. Installing Ogre 3D
Downloading and installing Ogre 3D
Time for action — downloading and installing Ogre 3D
What just happened?
Different versions of the Ogre 3D SDK
Exploring the SDK
The Ogre 3D samples
Time for action — building the Ogre 3D samples
What just happened?
Pop quiz — which post effects are shown in the samples
The first application with Ogre 3D
Time for action — starting the project and configuring the IDE
What just happened?
ExampleApplication
Pop quiz — which libraries to link
Loading the first model
Time for action — loading a model
What just happened?
Pop quiz — ExampleApplication and how to display a model
Summary
2. The Ogre Scene Graph
Creating a scene node
Time for action — creating a scene node with Ogre 3D
What just happened?
How to work with the RootSceneNode
3D space
Scene graph
Pop quiz — finding the position of scene nodes
Setting the position of a scene node
Time for action — setting the position of a scene node
What just happened?
Pop quiz — playing with scene nodes
Have a go hero — adding a Sinbad
Rotating a scene node
Time for action — rotating a scene node
What just happened?
Pop quiz — rotating a scene node
Have a go hero — using Ogre::Degree
Scaling a scene node
Time for action — scaling a scene node
What just happened?
Pop quiz — creating child scene nodes
Have a go hero — using createChildSceneNode()
Using a scene graph the clever way
Time for action — building a tree using scene nodes
What just happened?
Pop quiz — even more about the scene graph
Have a go hero — adding a following ninja
Different spaces in a scene
Time for action — translating in World space
What just happened?
Different spaces in a 3D scene
Translating in local space
Time for action — translating in local and parent space
What just happened?
Pop quiz — Ogre 3D and spaces
Have a go hero — adding symmetry
Rotating in different spaces
Time for action — rotating in different spaces
What just happened?
Scaling in different spaces
Summary
3. Camera, Light, and Shadow
Creating a plane
Time for action — creating a plane
What just happened?
Representing models in 3D
Adding a point light
Time for action — adding a point light
What just happened?
Have a go hero — adding a second point light
Adding a spotlight
Time for action — creating a spotlight
What just happened?
Spotlights
Pop quiz — different light sources
Have a go hero — mixing light colors
Directional lights
Time for action — creating a directional light
What just happened?
Pop quiz — different light types
The missing thing
Time for action — finding out what's missing
What just happened?
Adding shadows
Time for action — adding shadows
What just happened?
Creating a camera
Time for action — creating a camera
What just happened?
Have a go hero — doing more with the thing
Creating a viewport
Time for action — doing something that illustrates the thing "in action"
What just happened?
Have a go hero — playing with different aspect ratio
Summary
4. Getting User Input and Using the Frame Listener
Preparing a scene
Time for action — preparing a scene
What just happened?
Adding movement to the scene
Time for action — adding movement to the scene
What just happened?
FrameListener
Pop quiz — design pattern of FrameListener
Modifying the code to be time based rather than frame based
Time for action — adding time-based movement
What just happened?
Pop quiz — the difference between time- and frame-based movement
Have a go hero — adding a second model
Adding input support
Time for action — adding input support
What just happened?
Window handle
Pop quiz — window questions
Adding movement to the model
Time for action — controlling Sinbad
What just happened?
Have a go hero — using a speed factor for movement
Adding a camera
Time for action — making the camera work again
What just happened?
Mouse state
Pop quiz — capturing the input
Have a go hero — playing with the example
Adding wireframe and point render mode
Time for action — adding wireframe and point render mode
What just happened?
Adding a timer
Time for action — adding a timer
What just happened?
Have a go hero — changing the input mode
Summary
5. Animating models with Ogre 3D
Adding animations
Time for action — adding animations
What just happened?
Pop quiz — the importance of time
Have a go hero — adding a second model
Playing two animations at the same time
Time for action — adding a second animation
What just happened?
Have a go hero — adding a factor to the animation speed
Let's walk a bit
Time for action — combining user control and animation
What just happened?
Adding swords
Time for action — adding swords
What just happened?
Animations
Printing all the animations a model has
Time for action — printing all animations
What just happened?
Summary
6. Scene Managers
Starting with a blank sheet
Time for action — creating a blank sheet
What just happened?
Getting the scene manager's type
Time for action — printing the scene manager's type
What just happened?
What does a scene manger do?
Octree
Another scene manager type
Time for action — using another scene manager
What just happened?
ResourceManager
setWorldGeometry
Creating our own model
Time for action — creating a model for displaying blades of grass
What just happened?
Manual object
Texture mapping
Have a go hero — playing with the manual object
Adding volume to the blades of grass
Time for action — using more triangles for volume
What just happened?
Creating a field of grass
Time for action — building a field of grass
What just happened?
Exploring the name scheme
Time for action — printing the names
What just happened?
Static geometry
Time for action — using static geometry
What just happened?
Rendering pipeline
Indices
Summary
7. Materials with Ogre 3D
Creating a white quad
Time for action — creating the quad
What just happened?
Creating our own material
Time for action — creating a material
What just happened?
Materials
Have a go hero — creating another material
Texture coordinates take two
Time for action — preparing our quad
What just happened?
Using the wrapping mode with another texture
Time for action — adding a rock texture
What just happened?
Using another texture mode
Time for action — adding a rock texture
What just happened?
Using the mirror mode
Time for action — using the mirror mode
What just happened?
Using the border mode
Time for action — using the border mode
What just happened?
Changing the border color
Time for action — changing the border color
What just happened?
Pop quiz — texture modes
Have a go hero — Using texture modes
Scrolling a texture
Time for action — preparing to scroll a texture
What just happened?
Time for action — scrolling a texture
What just happened?
Animated scrolling
Time for action — adding animated scrolling
What just happened?
Inheriting materials
Time for action — inheriting from a material
What just happened?
Fixed Function Pipeline and shaders
Render Pipeline
Time for action — our first shader application
What just happened?
Writing a shader
Texturing with shaders
Time for action — using textures in shaders
What just happened?
What happens in the render pipeline?
Have a go hero — combining color and texture coordinates
Interpolating color values
Time for action — using colors to see interpolation
What just happened?
Replacing the quad with a model
Time for action — replacing the quad with a model
What just happened?
Making the model pulse on the x-axis
Time for action — adding a pulse
What just happened?
Summary
8. The Compositor Framework
Preparing a scene
Time for action — preparing the scene
What just happened?
Adding the first compositor
Time for action — adding a compositor
What just happened?
How the compositor works
Modifying the texture
Time for action — modifying the texture
What just happened?
Inverting the image
Time for action — inverting the image
What just happened?
Combining compositors
Time for action — combining two compositor effects
What just happened?
Decreasing the texture count
Time for action — decreasing the texture count
What just happened?
Combining compositors in code
Time for action — combing two compositors in code
What just happened?
Have a go hero — swapping the green and blue color channels
Something more complex
Time for action — complex compositor
What just happened?
Changing the number of pixels
Time for action — putting the number of pixels in the material
What just happened?
Have a go hero — trying different numbers of pixels
Setting the variable in code
Time for action — setting the variable from the application
What just happened?
Changing the number of pixels while running the application
Time for action — modifying the number of pixels with user input
What just happened?
Have a go hero — reducing parameter changes
Adding a split screen
Time for action — adding a split screen
What just happened?
Have a go hero — doing more with viewports
Putting it all together
Time for action — selecting a color channel
What just happened?
Summary
9. The Ogre 3D Startup Sequence
Starting Ogre 3D
Time for action — starting Ogre 3D
What just happened?
Adding resources
Time for action — loading the Sinbad mesh
What just happened?
Using resources.cfg
Time for action — using resources.cfg to load our models
What just happened?
Structure of a configuration file
Creating an application class
Time for action — creating a class
What just happened?
Adding a FrameListener
Time for action — adding a FrameListener
What just happened?
Investigating the FrameListener functionality
Time for action — experimenting with the FrameListener implementation
What just happened?
Time for action — returning true in the frameStarted function
What just happened?
Double buffering
Time for action — returning true in the frameRenderingQueued function
What just happened?
Time for action — returning true in the frameEnded function
What just happened?
Adding input
Time for action — adding input
What just happened?
Pop quiz — the three event handlers
Our own main loop
Time for action — using our own rendering loop
What just happened?
Adding a camera (again)
Time for action — adding a frame listener
What just happened?
Adding compositors
Time for action — adding compositors
What just happened?
Adding a plane
Time for action — adding a plane and a light
What just happened?
Adding user control
Time for action — controlling the model with the arrow keys
What just happened?
Adding animation
Time for action — adding animation
What just happened?
Have a go hero — looking up what we used
Summary
10. Particle Systems and Extending Ogre 3D
Adding a particle system
Time for action — adding a particle system
What just happened?
What is a particle system?
Creating a simple particle system
Time for action — creating a particle system
What just happened?
Some more parameters
Time for action — some new parameters
What just happened?
Pop quiz — what makes a particle system
Other parameters
Time for action — time to live and color range
What just happened?
Pop quiz — time to live
Turning it on and off again
Time for action — adding intervals to a particle system
What just happened?
Pop quiz — emitter parameters
Adding affectors
Time for action — adding a scaler affector
What just happened?
Changing colors
Time for action — changing the color
What just happened?
Have a go hero — change the color to red
Two-way changing
Time for action — change depending on the lifetime of a particle
What just happened?
Even more complex color manipulations
Time for action — using complex color manipulation
What just happened?
Adding randomness
Time for action — adding randomness
What just happened?
Deflector
Time for action — using the deflector plane
What just happened?
Have a go hero — doing more with the thing
Other emitter types
Time for action — using a box emitter
What just happened?
Emitting with a ring
Time for action — using a ring to emit particles
What just happened?
At the end, we would like some fireworks
Time for action — adding fireworks
What just happened?
Pop quiz — different types of emitter
Extending Ogre 3D
Speedtree
Hydrax
Caelum
Particle Universe
GUIs
CEGUI
BetaGUI
QuickGUI
Berkelium
Summary
The end
11. Pop quiz — Answers
Chapter 1
Installing Ogre 3D
Chapter 2
Setting up the Environment
Chapter 3
Felix Gogo
Chapter 4
Felix Gogo
Chapter 5
The Book Inventory Bundle
Chapter 7
The Bookshelf: First Stab
Chapter 9
The Ogre 3D Startup Sequence
Chapter 10
How About a Graphical Interface?
Index

Ogre 3D 1.7

Beginner's Guide

Ogre 3D 1.7

Beginner's Guide

Copyright © 2010 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

First published: November 2010

Production Reference: 1191110

Published by Packt Publishing Ltd.

32 Lincoln Road

Olton

Birmingham, B27 6PA, UK.

ISBN: 978-1-849512-48-0

www.packtpub.com

Cover Image by John M. Quick (<[email protected]>)

Credits

Author

Felix Kerger

Reviewers

Manuel Bua

Gregory Junker

Acquisition Editor

Usha Iyer

Development Editors

Hyacintha D'Souza

Mayuri Kokate

Technical Editor

Prashant Macha

Copy Editor

Leonard D'Silva

Indexers

Hemangini Bari

Monica Ajmera Mehta

Editorial Team Leader

Mithun Sehgal

Project Team Leader

Ashwin Shetty

Project Coordinator

Poorvi Nair

Proofreader

Sandra Hopper

Graphics

Nilesh Mohite

Production Coordinator

Adline Swetha Jesuthas

Cover Work

Adline Swetha Jesuthas

About the Author

Felix Kerger is a Computer Science student at the Technical University of Darmstadt and has been developing 3D real-time applications using Ogre 3D for more than five years. He has given several talks on software development and 3D real-time applications at different conferences and has been working for three years as an assistant researcher at the Fraunhofer Institute for Computer Graphics Research. He also works as a freelance journalist and reports yearly from the Game Developer Conference Europe.

I would like to thank the following persons, without whom this book wouldn't have been possible: Steve Streeting for devoting so much time to Ogre 3D and creating one of the best pieces of software I have had the pleasure to work with; my former teachers Ms. Oppel and Ms. Michel, who helped me write a report on which this book's idea is based ; my parents, who were a constant source of inspiration and motivation; Gregory Junker and Manuel Bua, my technical reviewers– their comments helped me no end and improved this book a lot; and, of course, the team at Packt for their constant help and advice.

About the Reviewers

Manuel Bua is a software and solutions architect from Trento, Italy. He has over 17 years' experience and has been involved in many small and large-scale software projects, at both the design and implementation levels.

His background and experience range from software development to reverse engineering, embracing both the desktop and the mobile platform; multithreading, parallel, and massively-parallel computing architectures also pique his interest greatly, as well as computational photography and games development.

In 2007, he joined Jooce's Research and Development division in Paris, France, holding the position of Chief Architect, engineering and optimizing their in-house, Actionscript-based virtual desktop platform connecting millions of people worldwide; during his staying, he also designed and implemented the compositing window manager governing windows transitions and effects, such as the well-known "Wobbly Windows," first introduced by Compiz on the (rocking!) Linux desktop.

He loves open standards and the open source culture. His desire to learn and to share his knowledge has led him to contribute to various projects, such as Ogre itself; he designed and programmed the original out-of-core implementation of what is known today as the "Compositor Framework," providing both the initial insight and the high-level concepts, laying the foundations for further research, work, and improvements.

He is currently employed at F4F Creative Factory, a design-inspired web and advertising agency based in Arco, Trento, in the roles of solutions architect, software engineer, and systems administrator.

Gregory Junker is the author of the APress book "Pro Ogre 3D Programming."

Preface

Creating 3D scenes and worlds is an interesting and challenging problem, but the results are hugely rewarding and the process to get there can be a lot of fun. This book is going to show you how you can create your own scenes and worlds with the help of Ogre 3D. Ogre 3D is one of the biggest open source 3D render engines and enables its users to create and interact freely with their scenes.

This book can't show all the details about Ogre 3D but rather provide a solid introduction with which you, as a reader, can start using Ogre 3D by yourself. After finishing the book, you will be able to use the documentation and the wiki to look up for the needed information and complex techniques, which aren't covered in this book.

What this book covers

Chapter 1, Installing Ogre 3D, shows how to get and configure Ogre 3D. We also create our first scene and start learning the internals of Ogre 3D

Chapter 2, The Ogre Scene Graph, introduces us to the concept of a scene graph and how it is used for describing 3D scenes

Chapter 3, Camera, Light, and Shadow, adds lights and shadows to our scene and also experiments with different camera settings

Chapter 4, Getting User Input and using the Frame Listener, adds interactivity to our application using user input

Chapter 5, Animating Models with Ogre 3D, will enhance our scene using animations to add more interactivity and realism

Chapter 6, Scene Managers, will introduce us to different concepts for organizing 3D scenes and what implication these choices will have

Chapter 7, Materials with Ogre 3D, will show us how to add a new level of detail and flexibility to our application using materials and shaders.

Chapter 8, The Compositor Framework, will show us how to add post processing effects to change the look of our complete scene with the knowledge about materials

Chapter 9, The Ogre 3D Startup Sequence, shows us how we can use Ogre 3D without the help of an ExampleApplication we had used previously

Chapter 10, Particle Systems and Extending Ogre 3D, gives an introduction to some more advanced techniques and perspectives that can be done with Ogre 3D

What you need for this book

You need a solid understanding of C++ and how to create applications using C++ for this book. Of course, you need a compiler to compile the example applications. This book uses Visual Studio as a reference, but any other compiler will also do. Your computer should have a graphic card with 3D capabilities. It would be best if the graphic card supports DirectX 9.0 because Ogre 3D is an open source software and we will download it in Chapter 1. So there is no need for you to have Ogre 3D already installed on your computer.

Who this book is for

If you ever wanted to develop 3D application with Ogre 3D, this example-driven book will enable you to do so. Understanding of C++ is needed to follow the examples in the book.

This book is an example-driven introduction to Ogre 3D. Each example shows some new features and you learn step-by-step to create complex scenes with different effects using Ogre 3D. After several examples discussing one topic, there is a do-it-yourself part where you will be challenged to solve problems on your own.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "Delete all the old code in createScene(), except for the plane-related code."

A block of code is set as follows:

void MyFragmentShader2(float2 uv : TEXCOORD0, out float4 color : COLOR, uniform sampler2D texture)

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Press Ok and start the Application. "

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book – what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to <[email protected]>, and mention the book title via the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail <[email protected]>.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Tip

Downloading the example code for this book

You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Note

Downloading the color images of this book

We also provide you a PDF file that has color images of the screenshots used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/2480_Ogre3D 1.7Beginner's Guide.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books – maybe a mistake in the text or the code – we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at <[email protected]> with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.

Chapter 1. Installing Ogre 3D

Downloading and installing a new library are the first steps of learning about and using it.

In this chapter, we shall do the following:

Download and install Ogre 3DHave our development environment working with Ogre 3DCreate our first scene rendered by Ogre 3D

So let's get on with it.

Downloading and installing Ogre 3D

The first step we need to take is to install and configure Ogre 3D.

Time for action — downloading and installing Ogre 3D

We are going to download the Ogre 3D SDK and install it so that we can work with it later.

Go to http://www.ogre3d.org/download/sdk.Download the appropriate package. If you need help picking the right package, take a look at the next What just happened section.Copy the installer to a directory you would like your OgreSDK to be placed in.Double-click on the Installer; this will start a self extractor.You should now have a new folder in your directory with a name similar to OgreSDK_vc9_v1-7-1.Open this folder. It should look similar to the following screenshot:

What just happened?

We just downloaded the appropriate Ogre 3D SDK for our system. Ogre 3D is a cross-platform render engine, so there are a lot of different packages for these different platforms. After downloading we extracted the Ogre 3D SDK.

Different versions of the Ogre 3D SDK

Ogre supports many different platforms, and because of this, there are a lot of different packages we can download. Ogre 3D has several builds for Windows, one for MacOSX, and one Ubuntu package. There is also a package for MinGW and for the iPhone. If you like, you can download the source code and build Ogre 3D by yourself. This chapter will focus on the Windows pre-build SDK and how to configure your development environment. If you want to use another operating system, you can look at the Ogre 3D Wiki, which can be found at http://www.ogre3d.org/wiki. The wiki contains detailed tutorials on how to set up your development environment for many different platforms. The rest of the book is completely platform independent, so if you want to use another development system, feel free to do so. It won't affect the content of this book besides the configuration and conventions of your build environment.

Exploring the SDK

Before we begin building the samples which come with the SDK, let's take a look at the SDK. We will look at the structure the SDK has on a Windows platform. On Linux or MacOS the structure might look different. First, we open the bin folder. There we will see two folders, namely, debug and release. The same is true for the lib directory. The reason is that the Ogre 3D SDK comes with debug and release builds of its libraries and dynamic-linked/shared libraries. This makes it possible to use the debug build during development, so that we can debug our project. When we finish the project, we link our project against the release build to get the full performance of Ogre 3D.

When we open either the debug or release folder, we will see many dll files, some cfg files, and two executables (exe). The executables are for content creators to update their content files to the new Ogre version, and therefore are not relevant for us.

The OgreMain.dll is the most important DLL. It is the compiled Ogre 3D source code we will load later. All DLLs with Plugin_ at the start of their name are Ogre 3D plugins we can use with Ogre 3D. Ogre 3D plugins are dynamic libraries, which add new functionality to Ogre 3D using the interfaces Ogre 3D offers. This can be practically anything, but often it is used to add features like better particle systems or new scene managers. What these things are will be discussed later. The Ogre 3D community has created many more plugins, most of which can be found in the wiki. The SDK simply includes the most generally used plugins. Later in this book, we will learn how to use some of them. The DLLs with RenderSystem_ at the start of their name are, surely not surprisingly, wrappers for different render systems that Ogre 3D supports. In this case, these are Direct3D9 and OpenGL. Additional to these two systems, Ogre 3D also has a Direct3D10, Direct3D11, and OpenGL ES(OpenGL for Embedded System) render system.

Besides the executables and the DLLs, we have the cfg files. cfg files are config files that Ogre 3D can load at startup. Plugins.cfg simply lists all plugins Ogre 3D should load at startup. These are typically the Direct3D and OpenGL render systems and some additional SceneManagers. quakemap.cfg is a config file needed when loading a level in the Quake3 map format. We don't need this file, but a sample does.

resources.cfg contains a list of all resources, like a 3D mesh, a texture, or an animation, which Ogre 3D should load during startup. Ogre 3D can load resources from the file system or from a ZIP file. When we look at resources.cfg, we will see the following lines:

Zip=../../media/packs/SdkTrays.zip

FileSystem=../../media/thumbnails

The Ogre 3D samples

Ogre 3D comes with a lot of samples, which show all the kinds of different render effects and techniques Ogre 3D can do. Before we start working on our application, we will take a look at the samples to get a first impression of Ogre's capabilities.

Time for action — building the Ogre 3D samples

To get a first impression of what Ogre 3D can do, we will build the samples and take a look at them.

Go to the Ogre3D folder.Open the Ogre3d.sln solution file.Right-click on the solution and select Build Solution.Visual Studio should now start building the samples. This might take some time, so get yourself a cup of tea until the compile process is finished.If everything went well, go into the Ogre3D/bin folder.Execute the SampleBrowser.exe.You should see the following on your screen:Try the different samples to see all the nice features Ogre 3D offers.

What just happened?

We built the Ogre 3D samples using our own Ogre 3D SDK. After this, we are sure to have a working copy of Ogre 3D.

Pop quiz — which post effects are shown in the samples

Name at least five different post effects that are shown in the samples.

a. Bloom, Glass, Old TV, Black and White, and Invert

b. Bloom, Glass, Old Monitor, Black and White, and Invert

c. Boom, Glass, Old TV, Color, and Invert

The first application with Ogre 3D

In this part, we will create our first Ogre 3D application, which will simply render one 3D model.

Time for action — starting the project and configuring the IDE

As with any other library, we need to configure our IDE before we can use it with Ogre 3D.

Create a new empty project.Create a new file for the code and name it main.cpp.Add the main function:
int main (void) { return 0; }
Include ExampleApplication.h at the top of the following source file:
#include "Ogre\ExampleApplication.h":
Add PathToYourOgreSDK\include\ to the include path of your project.Add PathToYourOgreSDK\boost_1_42 to the include path of your project.Add PathToYourOgreSDK\boost_1_42\lib to your library path.Add a new class to the main.cpp.
class Example1 : public ExampleApplication { public: void createScene() { } };
Add the following code at the top of your main function:
Example1 app; app.go();
Add PathToYourOgreSDK\lib\debug