3 * @author Ashley Tyndall (20915779), Jenna de la Harpe (20367932)
12 // Type definitions for vertex-coordinates, normals, texture-coordinates,
13 // and triangles (via the indices of 3 vertices).
14 typedef GLfloat vertex[3];
15 typedef GLfloat normal[3];
16 typedef GLfloat texCoord[2];
17 typedef GLint vertexIndex;
18 typedef vertexIndex triangle[3];
22 int nVertices; // The number of vertices in the mesh
23 vertex* vertices; // Array with coordinates of vertices
24 normal* normals; // Array with normals of vertices
25 texCoord* texCoords; // Array with texture-coordinates of vertices
26 int nTriangles; // The number of triangles in the mesh
27 triangle* triangles; // Array of trangles via 3 indices into "vertices"
30 // A type for a 2D texture, with height and width in pixels
34 GLubyte *rgbData; // Array of bytes with the colour data for the texture
37 // A type for point data
39 GLfloat x, y, z; // Amount of rotation on axis
42 // A type for texture id/scale data
48 // A type to maintain the state of an object in the scene
50 int mesh; // Mesh index number
51 texturedat texture; // Texture index number
52 GLfloat x,y,z; // Scene position
53 GLfloat scale[3]; // Scale vector
54 point rotation; // Rotation transformation
57 // A type to maintain the state of a light in the scene
59 GLfloat position[4]; // Light position
60 GLfloat ambient[4]; // Ambient parameter
61 GLfloat diffuse[4]; // Diffuse parameter
62 GLfloat specular[4]; // Specular parameter
63 GLfloat direction[3]; // Direction parameter
64 GLfloat cutoff; // Cutoff of light
65 char exponent; // Light exponent value, 0 - 128
73 M_ROTATION_TEXTURE_SCALE,
78 M_MATERIAL_AMBIENT_RGB,
79 M_MATERIAL_DIFFUSE_RGB,
80 M_MATERIAL_SPECULAR_RGB,
83 M_MATERIAL_GREEN_ADSS,
88 M_LIGHT_RGBALL_LIGHT_1,
90 M_LIGHT_RGBALL_LIGHT_2
93 // Manipulation states
94 enum manipulateStates {
95 STATE_CAMERA_ROTATE_MOVE,
96 STATE_OBJECT_POSITION_SCALE,
97 STATE_OBJECT_ROTATION_TEXTURE_SCALE,