Pro OpenGL ES for iOS

(singke) #1

CHAPTER 2: All That Math Jazz (^49)
What About Quaternions?
Quaternions are hyper-complex entities that can store the RPY information in a four-
dimensional vector-type thingie. They are very efficient in both performance and space
and are commonly used to model the instantaneous heading of an aircraft or spacecraft
in flight simulation. They are a curious creature with great properties but are reserved
for later.
GLKit and iOS5
Starting with iOS5, Apple introduced the GLKit, a collection of objects and helper
functions that can make OpenGL a little easier to handle. Among those is an extensive
math library with nearly 150 calls to handle vectors, matrices, and quaternions. OpenGL
ES 1.x has wrappers around the transformations, hiding much of the inner workings,
while OpenGL ES 2 does not. Up until the introduction of GLKit, hardy coders all across
this fair land had to roll-their-own or find other places to get the needed math libraries.
Apple added these both to make the lives of ES 2 coders a little better and to make it
easier to manage ports from 1.1.


Summary

In this chapter, you learned the basics of 3D mathematics. First the chapter covered 2D
transformations (rotation, translation, and scaling), and then 3D, with projection covered
as well. Although you will not likely need to code any transformations yourself, being
familiar with this chapter is key to understanding much of the OpenGL terminology later.
My head hurts.

Free download pdf