Search icon CANCEL
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

Into the third dimension!


You already live in a world with three dimensions. You can walk forward and backward, side to side, and jump up or duck. The reality of three dimensions becomes even more apparent if you are flying or even swimming.

Most 2D games operate by allowing the player to move left and right, or jump up or down. This is what we did when we created RoboRacer2D. In this type of 2D game, the missing dimension is depth. Our Robot could not move further away from us or closer to us. Considering that we were drawing him on a flat screen, it shouldn't be too surprising that he was limited to two dimensions.

Simulating 3D

Of course, artists found a way around this limitation hundreds of years ago by observing that as an object gets farther away from us, it gets smaller, and as it gets closer to us it gets larger. So, a simple way to represent 3D in a 2D world is to simply draw the more distant objects as smaller objects. 2D games learned this trick early on and used it to simulate...

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