libg3d Reference Manual | ||||
---|---|---|---|---|
#include <g3d/face.h> #define G3D_FLAG_MAT_TWOSIDE #define G3D_FLAG_FAC_NORMALS #define G3D_FLAG_FAC_TEXMAP G3DFace; gboolean g3d_face_get_normal (G3DFace *face, G3DObject *object, G3DFloat *nx, G3DFloat *ny, G3DFloat *nz); void g3d_face_free (G3DFace *face);
#define G3D_FLAG_MAT_TWOSIDE (1L << 0)
Faces using this material should be rendered two-sided as the direction is unknown.
#define G3D_FLAG_FAC_TEXMAP (1L << 1)
The face has a texture map and texture coordinates.
typedef struct { guint32 vertex_count; guint32 *vertex_indices; G3DMaterial *material; guint32 flags; G3DVector *normals; G3DImage *tex_image; guint32 tex_vertex_count; G3DVector *tex_vertex_data; } G3DFace;
An object representing a surface.
guint32 |
number of vertices |
guint32 * |
indices of vertices in G3DObject |
G3DMaterial * |
material to use for surface |
guint32 |
flags |
G3DVector * |
optional normal array (one vector - 3 G3DVector values - for each vertex) |
G3DImage * |
optional texture image |
guint32 |
number of texture vertices, should be 0 or match vertex_count |
G3DVector * |
array of texture vertices |
gboolean g3d_face_get_normal (G3DFace *face, G3DObject *object, G3DFloat *nx, G3DFloat *ny, G3DFloat *nz);
calculates the normal of a face.
|
face to calculate normal of |
|
object containing vertices of face |
|
x component of resulting normal |
|
y component of resulting normal |
|
z component of resulting normal |
Returns : |
TRUE on success, FALSE else |
void g3d_face_free (G3DFace *face);
Frees all memory allocated for this face.
|
the face to free |