kobject kgeom_put_data(
kobject object,
int primitive,
kvalist)
KGEOM_PRIMITIVE_POSITION
attribute.
If the entry in the primitive list at this
position does not match this primitive, an
error will result.
The variable argument list takes the form:
data1, data2, data3, ...
The number of data arguments in the variable argument list for each attribute depends on the primitive.
none
Geometry primitives typically consist of multiple data segments, with different primitives having different data segments associated with them. These data components are provided to this function via multiple data arguments.
For example, the following call will assign the data a list of sphere data to a geometry primitive.
float *locations = (float *) get_some_location_data();
float *colors = (float *) get_some_color_data();
float *radii = (float *) get_some_radii_data();
kgeom_put_data(object,KGEOM_SPHERES,locations,colors,radii);
Note that data does not have to be provided for all segments. In such cases, a NULL may be provided as the data argument. For example, to put a spheres primitive with no color data, the following call would be used.
kgeom_put_data(object,KGEOM_SPHERES,locations,NULL,radii);
The amount of data and data type expected for each
primitive component is determined by a number of
object level attributes. The primitive-level attribute
KGEOM_NUMBER_OF_VERTICES
should be set before
any data is put to indicate how much data is going to
be put. This is not true for the mesh primitives,
which each have their different size attributes.
A complete list of geometry attributes and primitives can be found in Chapter 3 of Programming Services Volume II.
none
none
kgeom_destroy_primitive_list()
.
$DATASERV/objects/library/koldgeom/src/geometry.c