]>
Dogcows Code - chaz/rasterize/blob - model.h
3 * CS5600 University of Utah
5 * mcgarvey@eng.utah.edu
17 #define MODEL_TYPE_RAW (1)
18 #define MODEL_TYPE_OBJ (2)
22 * A model is a group of geometry and its attributes.
24 typedef struct model model_t
;
28 * Allocate and load a model from a file. The file format of the model will
29 * be inferred from the filename extension.
31 model_t
* model_alloc(const char* filename
);
34 * Allocate and load a model from a file. You must explicitly pass the file
35 * format of the model data.
37 model_t
* model_alloc2(const char* filename
, int type
);
40 * Destroy a model, freeing up its memory.
42 void model_destroy(model_t
* m
);
46 * Get the model's geometry as a list of triangles.
48 const list_t
* model_geometry(const model_t
* m
);
51 * Get the number of triangles that make up the model.
53 int model_size(const model_t
* m
);
56 * Get a string representation for the model (i.e. a filename).
58 const char* model_name(const model_t
* m
);
61 * Get the color of the specular light property of the model.
63 color_t
model_specular(const model_t
* m
);
66 * Get the level of shininess of a model for use in lighting calculations.
68 scal_t
model_shininess(const model_t
* m
);
71 * Get the current transformation of the model. This can be changed by a call
74 void model_transformation(const model_t
* m
, mat_t
* transform
);
78 * Post-multiply a transformation matrix to the internal matrix representing
79 * the model's location and orientation.
81 void model_transform(model_t
* m
, const mat_t
* transform
);
84 * Set the material attributes of the model.
86 void model_material(model_t
* m
, color_t specular
, scal_t shininess
);
This page took 0.038859 seconds and 5 git commands to generate.