Previous Next


                                                 316
CHAPTER 4                                                                        Graphics



where
  f is the vertex’s edge flag (discussed below)
  x and y are its horizontal and vertical coordinates
  c1 … cn are its color components

All vertex coordinates are expressed in the shading’s target coordinate space. If
the shading dictionary includes a Function entry, only a single parametric value,
t, is permitted for each vertex in place of the color components c1 … cn .

The edge flag associated with each vertex determines the way it connects to the
other vertices of the triangle mesh. A vertex va with an edge flag value fa = 0
begins a new triangle, unconnected to any other. At least two more vertices (vb
and vc ) must be provided, but their edge flags are ignored. These three vertices
define a triangle (va , vb , vc ), as shown in Figure 4.16.



                                                fa = 0
                                         (Start new triangle)



                              Previous
                                                        va
                              triangle




                                               vb               vc




    FIGURE 4.16 Starting a new triangle in a free-form Gouraud-shaded triangle mesh


Subsequent triangles are defined by a single new vertex combined with two verti-
ces of the preceding triangle. Given triangle (va , vb , vc ), where vertex va precedes
vertex vb in the data stream and vb precedes vc , a new vertex vd can form a new
triangle on side vbc or side vac , as shown in Figure 4.17. (Side vab is assumed to be
shared with a preceding triangle and therefore is not available for continuing the
mesh.) If the edge flag is fd = 1 (side vbc ), the next vertex forms the triangle
(vb , vc , vd ); if the edge flag is fd = 2 (side vac ), the next vertex forms the triangle
(va , vc , vd ). An edge flag of fd = 0 would start a new triangle, as described above.

Previous Next