Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
OpenFrameworks Essentials

You're reading from   OpenFrameworks Essentials Create stunning, interactive openFrameworks-based applications with this fast-paced guide

Arrow left icon
Product type Paperback
Published in Apr 2015
Publisher
ISBN-13 9781784396145
Length 206 pages
Edition 1st Edition
Arrow right icon
Toc

Table of Contents (13) Chapters Close

Preface 1. Getting Started with openFrameworks FREE CHAPTER 2. Creating Your First openFrameworks Project 3. Adding a GUI and Handling Keyboard Events 4. Working with Raster Graphics – Images, Videos, and Shaders 5. Creating 3D Graphics 6. Animating Parameters 7. Distributed and Physical Computing with Networking and Arduino 8. Deploying the Project on iOS, Android, and Raspberry Pi 9. Further Resources A. Video Synthesizer Reference B. openFrameworks Quick Reference Index

Creating a camera


One of the advantages of 3D graphics over 2D graphics is the possibility of walking through the virtual scene and rotating objects in a way we do in real life. So the user feels as though he or she were inside that scene, observing real objects. The navigating in space is achieved using a camera. It is a special object that controls the way of projecting 3D points to 2D points on the screen.

Tip

There are two types of projections from 3D to 2D:

  • Perspective projection: Far-off objects look smaller than nearby objects. This is the type of projection used in openFrameworks by default.

  • Orthogonal projection: The visible size of an object does not depend on the distance to the viewer.

In openFrameworks, a camera can be represented by the ofCamera class or the ofEasyCam class. The first class is a quite general camera class, and the second one extends it by implementing a number of additional capabilities, including handling mouse events for controlling the camera.

Tip

To enable orthogonal...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image