model

model — Model manipulation functions

Synopsis




G3DModel*   g3d_model_new                   (void);
G3DModel*   g3d_model_load                  (G3DContext *context,
                                             const gchar *filename);
gboolean    g3d_model_check                 (G3DModel *model);
gboolean    g3d_model_center                (G3DModel *model);
void        g3d_model_clear                 (G3DModel *model);
void        g3d_model_free                  (G3DModel *model);
G3DObject*  g3d_model_get_object_by_name    (G3DModel *model,
                                             const gchar *name);

Description

Details

g3d_model_new ()

G3DModel*   g3d_model_new                   (void);

This functions allocates and initializes a new G3DModel.

Returns : a newly allocated G3DModel

g3d_model_load ()

G3DModel*   g3d_model_load                  (G3DContext *context,
                                             const gchar *filename);

Loads a model from a file. The model is checked, centered, resized, optimized.

context : a valid context
filename : the file name of the model to load
Returns : the loaded model or NULL in case of an error

g3d_model_check ()

gboolean    g3d_model_check                 (G3DModel *model);

Checks whether a model returned by plugin is valid.

model : the model to check
Returns : TRUE on success, FALSE on error

g3d_model_center ()

gboolean    g3d_model_center                (G3DModel *model);

Translates all object coordinates that the object center is at (0, 0, 0)

model : the model to center
Returns : TRUE on success, FALSE on error

g3d_model_clear ()

void        g3d_model_clear                 (G3DModel *model);

Removes all objects from a model.

model : the model to clear

g3d_model_free ()

void        g3d_model_free                  (G3DModel *model);

Frees all memory allocated for the model including all objects, materials and textures.

model : the model to free

g3d_model_get_object_by_name ()

G3DObject*  g3d_model_get_object_by_name    (G3DModel *model,
                                             const gchar *name);

Searches the object tree for an object with the given name.

model : the model containing all objects
name : the name of the requested object
Returns : the requested object or NULL if non was found