Pro OpenGL ES for iOS

(singke) #1

CHAPTER 3: Building a 3D World (^73)
Figure 3-11. Scaling before the rotations have been executed (left) and scaling after the rotations (right)
The geometry is rotated first, and then the cube’s local axis is rotated, which no longer
aligns with the origin’s axis. Following that with scale, it is stretched out along the
world’s y-axis, instead of its own. This would be as if you already started with a vertex
list of a cube rotated partway and scaled it with nothing else. So if you make the scaling
at the very end, your entire world is scaled.
Tweaking the Values
Now some more fun comes when we can start playing with various values. This section
will demonstrate a number of the various principles that are not just relevant to OpenGL
ES but found in nearly every 3D toolkit you’re likely to stumble across.
Clipping Regions
With a working demo, we can have fun by tweaking some of values and observing the
changes. First we’ll change the far clipping plane in the frustum by changing the value of

Free download pdf