Back Patch Culling
155
Updating the View Vector
As long as you use csDrawAction::apply() to initiate the back patch culling, you never
need to calculate the view vector.
If you need greater control over the Draw process and use csDrawAction::draw(), you
need to update the view vector using csDrawAction::updateViewVector().
csDrawAction::getViewVector() returns the view vector.
Normals
Two types of normals can be used to calculate the viewing angle:
• Face normal—the normal to the surface of an element.
• Primitive normal—the normal to all of the vertices of the elements when the
PER_VERTEX_NORMAL binding is used, or the normal to the csGeoSet when any
other binding is used.
Figure 14-3 shows these two types of normals.
Figure 14-3 Face and Primitive Normals
Face normals can be calculated given the vertices; primitive normals must be provided
by the scene graph.
The direction of the face normal follows the right hand rule: your thumb points in the
direction of the normal when the fingers on your right hand wrap in the direction of the
ordered vertices, as shown in Figure 14-4.
Face normal
Primitive normal
Primitive normal
Primitive normal