User's Manual
22
Chapter 2: Creating Geometries
The enumerated binding values that are valid for each of the attributes coincide with the
entries in Table 2-3.
enum NormalBindEnum
{
NO_NORMS,
OVERALL_NORMS,
PER_PRIM_NORMS,
PER_VERTEX_NORMS,
};
enum ColorBindEnum
{
NO_COLORS,
OVERALL_COLORS,
PER_PRIM_COLORS,
PER_VERTEX_COLORS,
};
enum TexCoordBindEnum
{
NO_TEX_COORDS,
PER_VERTEX_TEX_COORDS
}
To set the color of all the primitives in a csGeoSet object to the same value, for example,
use the OVERALL_COLORS binding in code similar to the following:
csTriangleStripSet* myTriangleStrip = new csTriangleStripSet();
myTriangleStrip->setColorBind(csGeoSet::OVERALL_COLORS);
Setting Attributes
Now that you know how to set attribute bindings, you need to know how to set the
attributes themselves.
As shown in Figure 2-1, csGeoSet objects store their primitives in an array. The array
contains:
• Three attribute values in the Normal array.
• Three (or four) attribute values in the Color array.
• Two attribute values in the Texture Coordinate array.
• Three attribute values in the Coordinate array.