A SERVICE OF

logo

26
Chapter 2: Creating Geometries
Specifying Attributes
Whether you index your attributes or not, you must use the following set...() methods in
csGeoSet to specify the attributes in a specic csGeoSet object:
void setCoordsSet(csCoordSet* coords);
void setNormalsSet(csNormalSet* normals);
void setColorsSet(csColorSet* colors);
void setTexCoordsSet(csTexCoordSet* texCoords);
There is a corresponding set of get...() methods that retrieve the index settings for the
coordinates, normals, colors, and texture coordinates, respectively.
The set...() methods have the following arguments:
coords is a three-dimensional array of coordinates representing the coordinates of
every vertex in every primitive in a csGeoSet object.
normals is a three-dimensional array of normals for potentially every vertex in every
primitive in a csGeoSet object, depending on the binding.
colors is a four-dimensional array of colors for potentially every vertex in every
primitive in a csGeoSet object, depending on the binding.
texCoords is a two-dimensional array of coordinates representing the texture
coordinates of every vertex in every primitive in a csGeoSet object.
Using More Specic Attribute Arrays
Each of the four attributes has its own array. You must use one of the more
specically-dened virtual array classes, as follows:
csCoordSet3f();
csNormalSet3f();
csColorSet3f();
csColorSet4f();
csTexCoordSet2f();
Each of these null constructors is overridden by a set of two constructors that are similar
in form to the following:
csCoordSet3f(int n);
csCoordSet3f(csData *array, short offset, short stride);