Top | ![]() |
![]() |
![]() |
![]() |
Objects are parts of a model. In most file formats vertices and faces are grouped in some way into objects. Objects can be hierarchical, so what a model contains is basically an object tree.
void
g3d_object_free (G3DObject *object
);
Frees all memory allocated for that object.
gdouble
g3d_object_radius (G3DObject *object
);
Calculates the radius of the object. This is the maximum from the center to a vertex.
gboolean g3d_object_scale (G3DObject *object
,G3DFloat scale
);
Resizes the object by the factor scale
.
gboolean g3d_object_transform (G3DObject *object
,G3DMatrix *matrix
);
Multiplies all vertices of the object with the transformation matrix.
gboolean g3d_object_transform_normals (G3DObject *object
,G3DMatrix *matrix
);
Multiplies all normals of the object with the transformation matrix.
G3DObject *
g3d_object_duplicate (G3DObject *object
);
Duplicates an object with all vertices, faces and materials.
gboolean
g3d_object_optimize (G3DObject *object
);
Puts all vertex and face information into special arrays for faster rendering. It is deprecated and should not be used.
typedef struct { gchar *name; GSList *materials; GSList *faces; GSList *objects; /* transformation, may be NULL */ G3DTransformation *transformation; /* don't render this object */ gboolean hide; /* vertices */ guint32 vertex_count; G3DVector *vertex_data; } G3DObject;
A three-dimensional object.
gchar * |
name of object |
|
GSList * |
list of materials |
|
GSList * |
list of faces |
|
GSList * |
list of sub-objects |
|
G3DTransformation * |
optional transformation |
|
gboolean |
flag to disable object rendering |
|
guint32 |
number of vertices |
|
G3DVector * |
vertex vector data |