Game Development Reference
In-Depth Information
Figure 7-2. The near clipping plane (also known as the projection plane) and its coordinate system
Note that the coordinate system is by no means fixed. We can manipulate it so that we can work
in any projected coordinate system we like; for example, we could instruct OpenGL ES to let the
origin be in the bottom-left corner, and let the visible area of the “retina� be 480 units on the x
axis, and 320 units on the y axis. Sounds familiar? Yes, OpenGL ES allows you to specify any
coordinate system you want for the projected points.
Once we specify our view frustum, OpenGL ES then takes each point of a triangle and shoots
a ray from it through the projection plane. The difference between a parallel projection and a
perspective projection is how the directions of those rays are constructed. Figure 7-3 shows the
difference between the two, viewed from above.
Figure 7-3. A perspective projection (left) and a parallel projection (right)
A perspective projection shoots the rays from the triangle points through the camera (or eye, in
this case). Objects further away will thus appear smaller on the projection plane. When we use
a parallel projection, the rays are shot perpendicular to the projection plane. In this scenario, an
object will maintain its size on the projection plane no matter how far away it is.
Our projection plane is called a near clipping plane in OpenGL ES lingo, as pointed out earlier. All
of the sides of the view frustum have similar names. The one furthest away from the camera is
called the far clipping plane . The others are called the left , right , top , and bottom clipping planes.
Anything outside or behind those planes will not be rendered. Objects that are partially within the
view frustum will be clipped from these planes, meaning that the parts outside the view frustum
get cut away. That's where the name clipping plane comes from.
 
Search WWH ::




Custom Search