A SERVICE OF

logo

Creating csGeoSet Objects
17
Each class has methods that allow you to set and retrieve the values necessary to dene
the geometry, including (where appropriate)
coordinates of the center
length of the radius
height
width
The names of the methods that set and retrieve these values are intuitively obvious, for
example, to set and retrieve the coordinates of the center of a geometry, you use methods
similar to the following:
void setCenter(const csVec3f& center);
void getCenter(csVec3f& center);
Creating csGeoSet Objects
csGeoSet is a virtual class from which all geometric primitives are derived. Each
csGeoSet-derived class contains a collection of primitives, such as points, quads, or
triangle strips. All of the primitives in a collection are of the same type. You can construct
a geometric object by specifying the coordinates of several of these primitives and
combine them in a collection. For example, you can arrange triangles to form a sphere or
a landscape. The vertices, normals, colors, and texture coordinates of each primitive are
captured as attributes of each primitive.
Figure 2-1 illustrates how:
Each csGeoSet-derived object contains an array of primitive shapes.
Each primitive is made of an array of four attributes.
Each of the four attributes refers to an array of attribute values, as shown in
Figure 2-1.
Note: The order of the attributes can be changed depending on the needs of the
application.