Graphics Programs Reference
In-Depth Information
3. Scroll to the top of this file. The “normal:” block consists of per-vertex
normals. You use this (in Chapter 5 ) for advanced programming in
OpenGL ES, such as the computation of shading values. Although the
parser internally stores per-vertex, as well as per-face (face is a triangle
mesh) normals, it uses the per-face normals when averaging normals ad-
jacent to a vertex normal. The output shown in this block is the averages
of these face normals adjacent to per-vertex normals. Note again that the
mesh data in every block follows the same order as in the “color:”
block.
4. The next two blocks, “vertex:” and “index:”, are the most important
blocks. You must have understood already that they represent unique
vertices and element indices, respectively. The mesh data in these
blocks is ready for use with glDrawElements (with mode
GL_TRIANGLES ). Also note that in the label “size:<NUMBER > ” in
the “index:” block, <NUMBER > specifies the count of indices, passed
as an argument to glDrawElements .
Figure 4-51 . TANK FENCE ELEMENTS 1: Player object
The section “Drawing line and triangle primitives” discussed using glDrawEle-
ments with mode GL_TRIANGLES . It also talked about the GL TRIANGLE
ELEMENTS application ( Chapter4/gltriangleelements.zip ) to render
triangle primitives, as shown in Figure 4-2 . Similar to this application, there are three
other applications (in the source code for this chapter)— TANK FENCE ELEMENTS
 
Search WWH ::




Custom Search