Book Image

OGRE 3D 1.7 Application Development Cookbook

By : Ilya Grinblat, Alex Peterson
Book Image

OGRE 3D 1.7 Application Development Cookbook

By: Ilya Grinblat, Alex Peterson

Overview of this book

<p>OGRE (Object-oriented Graphics Rendering Engine) 3D is a scene-oriented, flexible 3D engine written in C++ designed to make it easier and more intuitive for developers to produce applications utilizing hardware-accelerated 3D graphics.</p> <p>Graphics application development with OGRE 3D may start small, but may soon balloon into monstrously complex beasts, which just can't be all understood at once. This book will help you to easily develop applications using OGRE 3D.<br /><br /><i>OGRE 3D 1.7 Application Development Cookbook</i> will help solve common problems you may face while developing 3D graphics applications using OGRE 3D. You will learn to create various types of Windows applications, scene querying, and visibility analysis among other things from this book.</p> <p>This book includes some advanced recipes involved in developing applications with OGRE 3D. Each recipe deals with adding some specific feature to your application.</p> <p>The book first covers creating various types of Windows applications available for the OGRE developer, creating plugins for customization, and OGRE resources management. You will then learn to efficiently implement various input methods for OGRE applications followed by managing scenes and objects impressively. Lights, special effects, and materials that provide enhancing effects are covered next. Further, character motion and collision detection are included followed by animations and multimedia, which help in producing a thorough professional look. Finally, we wrap it up with scene queries and views.</p> <p><i>OGRE 3D 1.7 Application Development Cookbook</i> provides a great reference for your OGRE 3D application development needs and helps you to deliver impressive results more quickly and with greater ease.</p>
Table of Contents (15 chapters)
OGRE 3D 1.7 Application Development Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface

Using the mouse input to navigate an Ogre scene


In this recipe, we will learn how to navigate an Ogre scene using a mouse input in an MFC environment.

How to do it...

We'll start by following the Creating an MFC Ogre application recipe from Chapter 1, Delving Deep into Application Design, to create an Ogre MFC application named MouseInput, and we'll add a mouse input to move the camera in the 3D scene.

  1. 1. The first thing to do is open the MFC Class Wizard, by clicking on Class Wizard on the Project menu. Select MouseInput in the Project listbox, and then CMouseInputView in the Class name list-box.

  2. 2. Next, we add message handlers for several mouse messages and end up with a message map that looks similar to the following:

    BEGIN_MESSAGE_MAP(CMouseInputView, CView)
      ON_WM_CONTEXTMENU()
      ON_WM_RBUTTONUP()
      ON_WM_PAINT()
      ON_WM_TIMER()
      ON_WM_LBUTTONDOWN()
      ON_WM_LBUTTONUP()
      ON_WM_MBUTTONDOWN()
      ON_WM_MBUTTONUP()
      ON_WM_MOUSEHOVER()
      ON_WM_MOUSEHWHEEL()
      ON_WM_MOUSEMOVE()
      ON_WM_MOUSEWHEEL...