Game Development Reference
In-Depth Information
y
Viewport
z
Frustrum
X
Eye or Camera
Z
Figure 4-4. Viewport transformation
Specific Overview of the Rendering Procedure
Let's discuss in greater detail how a 3D object is rendered onscreen using OpenGL ES 2.0
specifically. Matrix transformations and vertex and fragment shaders are covered.
Transforming the 3D Object's Vertices
In this section, I will discuss in detail how to put a 3D object on the screen. In order to put a 3D
object onscreen, we must transform each of the object's vertex coordinates, taking into account
the object's position in the world, the camera position and orientation, the projection type, and the
viewport specifications (see Figure 4-5 ). Remember that the coordinates are in (x,y,z) format but are
internally represented in homogeneous vertex format, which is (x,y,z,1). This is why 4-by-4 matrices
are needed to transform a vertex in OpenGL.
 
Search WWH ::




Custom Search