Use your business data to your advantage with the help of Syncfusion’s new data science offerings. Discover how a custom big data solution can provide your company with valuable predictions about key market trends.

OGRE 3D 1.7 Beginner's Guide

Beginner's Guide

Felix KergerNovember 2010

With your knowledge of C++ and this guide, the gaming world awaits you. Starting with the basics of the OGRE 3D graphics rendering engine, it takes you from the essentials right through to advanced features and plugins.

$21.60

$44.99

RRP $26.99

RRP $44.99

eBook

Print + eBook

Want this title & more?

$21.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781849512480

Paperback300 pages

About This Book

Easy-to-follow introduction to OGRE 3D

Create exciting 3D applications using OGRE 3D

Create your own scenes and monsters, play with the lights and shadows, and learn to use plugins

Get challenged to be creative and make fun and addictive games on your own

Who This Book Is For

If you have ever wanted to develop 3D applications 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.

Table of Contents

Chapter 1: Installing Ogre 3D

Downloading and installing Ogre 3D

Time for action — downloading and installing Ogre 3D

The Ogre 3D samples

Time for action — building the Ogre 3D samples

The first application with Ogre 3D

Time for action — starting the project and configuring the IDE

Loading the first model

Time for action — loading a model

Summary

Chapter 2: The Ogre Scene Graph

Creating a scene node

Time for action — creating a scene node with Ogre 3D

Setting the position of a scene node

Time for action — setting the position of a scene node

Rotating a scene node

Time for action — rotating a scene node

Scaling a scene node

Time for action — scaling a scene node

Using a scene graph the clever way

Time for action — building a tree using scene nodes

Have a go hero — adding a following ninja

Different spaces in a scene

Time for action — translating in World space

Translating in local space

Time for action — translating in local and parent space

Rotating in different spaces

Time for action — rotating in different spaces

Scaling in different spaces

Summary

Chapter 3: Camera, Light, and Shadow

Creating a plane

Time for action — creating a plane

Adding a point light

Time for action — adding a point light

Adding a spotlight

Time for action — creating a spotlight

Directional lights

Time for action — creating a directional light

The missing thing

Time for action — finding out what's missing

Adding shadows

Time for action — adding shadows

Creating a camera

Time for action — creating a camera

Creating a viewport

Time for action — doing something that illustrates the thing "in action"

Summary

Chapter 4: Getting User Input and Using the Frame Listener

Preparing a scene

Time for action — preparing a scene

Adding movement to the scene

Time for action — adding movement to the scene

Modifying the code to be time based rather than frame based

Time for action — adding time-based movement

Adding input support

Time for action — adding input support

Adding movement to the model

Time for action — controlling Sinbad﻿

Adding a camera

Time for action — making the camera work again

Adding wireframe and point render mode

Time for action — adding wireframe and point render mode

Adding a timer

Time for action — adding a timer

Summary

Chapter 5: Animating models with Ogre 3D

Adding animations

Time for action — adding animations

Playing two animations at the same time

Time for action — adding a second animation

Let's walk a bit

Time for action — combining user control and animation

Adding swords

Time for action — adding swords

Printing all the animations a model has

Time for action — printing all animations

Summary

Chapter 6: Scene Managers

Starting with a blank sheet

Time for action — creating a blank sheet

Getting the scene manager's type

Time for action — printing the scene manager's type

Another scene manager type

Time for action — using another scene manager

Creating our own model

Time for action — creating a model for displaying blades of grass

Adding volume to the blades of grass

Time for action — using more triangles for volume

Creating a field of grass

Time for action — building a field of grass

Exploring the name scheme

Time for action — printing the names

Static geometry

Time for action — using static geometry

Summary

Chapter 7: Materials with Ogre 3D

Creating a white quad

Time for action — creating the quad

Creating our own material

Time for action — creating a material

Texture coordinates take two

Time for action — preparing our quad

Using the wrapping mode with another texture

Time for action — adding a rock texture

Using another texture mode

Time for action — adding a rock texture

Using the mirror mode

Time for action — using the mirror mode

Using the border mode

Time for action — using the border mode

Changing the border color

Time for action — changing the border color

Scrolling a texture

Time for action — preparing to scroll a texture

Time for action — scrolling a texture

Animated scrolling

Time for action — adding animated scrolling

Inheriting materials

Time for action — inheriting from a material

Fixed Function Pipeline and shaders

Time for action — our first shader application

Texturing with shaders

Time for action — using textures in shaders

Interpolating color values

Time for action — using colors to see interpolation

Replacing the quad with a model

Time for action — replacing the quad with a model

Making the model pulse on the x-axis

Time for action — adding a pulse

Summary

Chapter 8: The Compositor Framework

Preparing a scene

Time for action — preparing the scene

Adding the first compositor

Time for action — adding a compositor

Modifying the texture

Time for action — modifying the texture

Inverting the image

Time for action — inverting the image

Combining compositors

Time for action — combining two compositor effects

Decreasing the texture count

Time for action — decreasing the texture count

Combining compositors in code

Time for action — combing two compositors in code

Something more complex

Time for action — complex compositor

Changing the number of pixels

Time for action — putting the number of pixels in the material

Setting the variable in code

Time for action — setting the variable from the application

Changing the number of pixels while running the application

Time for action — modifying the number of pixels with user input

Adding a split screen

Time for action — adding a split screen

Putting it all together

Time for action — selecting a color channel

Summary

Chapter 9: The Ogre 3D Startup Sequence

Starting Ogre 3D

Time for action — starting Ogre 3D

Adding resources

Time for action — loading the Sinbad mesh

Using resources.cfg

Time for action — using resources.cfg to load our models

Creating an application class

Time for action — creating a class

Adding a FrameListener

Time for action — adding a FrameListener

Investigating the FrameListener functionality

Time for action — experimenting with the FrameListener implementation

Time for action — returning true in the frameStarted function

Time for action — returning true in the frameRenderingQueued function

Time for action — returning true in the frameEnded function

Adding input

Time for action — adding input

Our own main loop

Time for action — using our own rendering loop

Adding a camera (again)

Time for action — adding a frame listener

Adding compositors

Time for action — adding compositors

Adding a plane

Time for action — adding a plane and a light

Adding user control

Time for action — controlling the model with the arrow keys

Adding animation

Time for action — adding animation

Summary

Chapter 10: Particle Systems and Extending Ogre 3D

Adding a particle system

Time for action — adding a particle system

Creating a simple particle system

Time for action — creating a particle system

Some more parameters

Time for action — some new parameters

Other parameters

Time for action — time to live and color range

Turning it on and off again

Time for action — adding intervals to a particle system

Adding affectors

Time for action — adding a scaler affector

Changing colors

Time for action — changing the color

Two-way changing

Time for action — change depending on the lifetime of a particle

Even more complex color manipulations

Time for action — using complex color manipulation

Adding randomness

Time for action — adding randomness

Deflector

Time for action — using the deflector plane

Other emitter types

Time for action — using a box emitter

Emitting with a ring

Time for action — using a ring to emit particles

At the end, we would like some fireworks

Time for action — adding fireworks

Extending Ogre 3D

Summary

The end

Chapter 11: Pop quiz — Answers

Chapter 1

Chapter 2

Chapter 3

Chapter 4

Chapter 5

Chapter 7

Chapter 9

Chapter 10

What You Will Learn

Learn the basics of OGRE 3D

Understand the scene graph

Develop 3D scenes with OGRE 3D

Create complex scenes

Write your own shaders and add them to scenes

Add lights and shadows

Add compositors to 3D scene for post-processing effects

Learn more about user control and animation

Extend OGRE 3D with plugins

In Detail

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.

Authors

Felix Kerger

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 5 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.

Alerts & Offers

Series & Level

We understand your time is important. Uniquely amongst the major publishers, we seek to develop and publish the broadest range of learning and information products on each technology. Every Packt product delivers a specific learning pathway, broadly defined by the Series type. This structured approach enables you to select the pathway which best suits your knowledge level, learning style and task objectives.

Learning

As a new user, these step-by-step tutorial guides will give you all the practical skills necessary to become competent and efficient.

Beginner's Guide

Friendly, informal tutorials that provide a practical introduction using examples, activities, and challenges.

Essentials

Fast paced, concentrated introductions showing the quickest way to put the tool to work in the real world.

Cookbook

A collection of practical self-contained recipes that all users of the technology will find useful for building more powerful and reliable systems.

Blueprints

Guides you through the most common types of project you'll encounter, giving you end-to-end guidance on how to build your specific solution quickly and reliably.

Mastering

Take your skills to the next level with advanced tutorials that will give you confidence to master the tool's most powerful features.

Starting

Accessible to readers adopting the topic, these titles get you into the tool or technology so that you can become an effective user.

Progressing

Building on core skills you already have, these titles share solutions and expertise so you become a highly productive power user.