Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
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
OpenGL Game Development By Example

You're reading from   OpenGL Game Development By Example Design and code your own 2D and 3D games efficiently using OpenGL and C++

Arrow left icon
Product type Paperback
Published in Mar 2016
Publisher
ISBN-13 9781783288199
Length 340 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Robert Madsen Robert Madsen
Author Profile Icon Robert Madsen
Robert Madsen
Stephen Madsen Stephen Madsen
Author Profile Icon Stephen Madsen
Stephen Madsen
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

The camera


In Chapter 2, Your Point of View we compared creating games to making a video recording. Your video camera captures a part of the view in front of you. If objects move into or out of that field of view, they are no longer in the video recording.

3D games use a camera as well. OpenGL allows you to move the game camera on six axes: up, down, left, right, in, and out. As you move the game camera, the objects that are in its view change.

Let's say that you center the camera on the car in the scene and pan to the left or right. The car will move in and out of the field of view. Of course the same occurs if you pan the camera up or down. Move back (or zoom out) and the car appears smaller. Move forward (or zoom in) and the car appears larger. Tilt the camera and the car will appear to be going uphill, downhill, or even appear upside down!

Remember those home movies?

Remember those home movies where the whole scene would jump around as the camera moved? Obviously, the position and movement...

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