2 * Global Variables File
3 * Contains all of the project's global variables
4 * @author Ashley Tyndall (20915779), Jenna de la Harpe (20367932)
10 mesh* meshes[NMESH]; // An array of pointers to the meshes - see getMesh
11 texture* textures[NTEXTURE]; // An array of texture pointers - see getTexture
14 const char *textureMenuEntries[NTEXTURE] = {
15 "1 Plain", "2 Rust", "3 Concrete", "4 Carpet", "5 Beach Sand",
16 "6 Rocky", "7 Brick", "8 Water", "9 Paper", "10 Marble",
17 "11 Wood", "12 Scales", "13 Fur", "14 Denim", "15 Hessian",
18 "16 Orange Peel", "17 Ice Crystals", "18 Grass", "19 Corrugated Iron", "20 Styrofoam",
19 "21 Bubble Wrap", "22 Leather", "23 Camouflage", "24 Asphalt", "25 Scratched Ice",
20 "26 Rattan", "27 Snow", "28 Dry Mud", "29 Old Concrete", "30 Leopard Skin"
23 const char *objectMenuEntries[NMESH] = {
24 "1 Thin Dinosaur","2 Big Dog","3 Saddle Dinosaur", "4 Dragon", "5 Cleopatra",
25 "6 Bone I", "7 Bone II", "8 Rabbit", "9 Long Dragon", "10 Buddha",
26 "11 Sitting Rabbit", "12 Frog", "13 Cow", "14 Monster", "15 Sea Horse",
27 "16 Head", "17 Pelican", "18 Horse", "19 Kneeling Angel", "20 Porsche I",
28 "21 Truck", "22 Statue of Liberty", "23 Sitting Angel", "24 Metal Part", "25 Car",
29 "26 Apatosaurus", "27 Airliner", "28 Motorbike", "29 Dolphin", "30 Spaceman",
30 "31 Winnie the Pooh", "32 Shark", "33 Crocodile", "34 Toddler", "35 Fat Dinosaur",
31 "36 Chihuahua", "37 Sabre-toothed Tiger", "38 Lioness", "39 Fish", "40 Horse (head down)",
32 "41 Horse (head up)", "42 Skull", "43 Fighter Jet I", "44 Toad", "45 Convertible",
33 "46 Porsche II", "47 Hare", "48 Vintage Car", "49 Fighter Jet II", "50 Winged Monkey",
34 "51 Chef", "52 Parasaurolophus", "53 Rooster", "54 T-rex"
37 SceneObject sceneObjs[MAXOBJECTS]; // An array with details of the objects in a scene
38 int nObjects = 0; // How many objects there are in the scene currently.
39 int curObject = -1; // The scene object that is currently selected, (-1 is no object)
40 int buttonSelected = -1; // Either GLUT_LEFT_BUTTON, GLUT_MIDDLE_BUTTON or -1 (no button)
41 int manipulateState = STATE_CAMERA_ROTATE_MOVE; // See manipulateStates enum
43 // Directories containing models
44 char *dirDefault1 = "models-textures";
45 char *dirDefault2 = "/cslinux/examples/CITS2231/project-files/models-textures";
47 char dataDir[200]; // Stores the directory name for the meshes and textures.
51 /* Size of floor, from -n to n, floorSize must be divisible by squareSize */
55 /* Current camera x, y, z coords */
56 GLfloat camx = 0.0, camy = 0.0, camz = 0.0, keyrot = 0.0;
59 /* Length of axis lines */
60 GLfloat lineLength = 10;
62 /* Light 0 parameters */
63 GLfloat diffuse0[]={1.0, 0.0, 0.0, 1.0};
64 GLfloat ambient0[]={1.0, 0.0, 0.0, 1.0};
65 GLfloat specular0[]={1.0, 0.0, 0.0, 1.0};
66 GLfloat direction0[] = {0.0, 0.0, 0.0};
68 GLfloat lightPosition0[4];
70 float lightAngle0 = 0.0, lightHeight0 = 5;
71 int lightMoving0 = 0, lightStartX0, lightStartY0;
73 /* Light 1 parameters */
74 GLfloat diffuse1[]={0.0, 1.0, 0.0, 1.0};
75 GLfloat ambient1[]={0.0, 1.0, 0.0, 1.0};
76 GLfloat specular1[]={0.0, 1.0, 0.0, 1.0};
77 GLfloat direction1[] = {0.0, 0.0, 0.0};
79 GLfloat lightPosition1[4];
81 float lightAngle1 = 360.0, lightHeight1 = 5;
82 int lightMoving1 = 0, lightStartX1, lightStartY1;
85 GLfloat ambient[] = {0.2, 0.2, 0.2, 1.0};
86 GLfloat diffuse[] = {1.0, 0.8, 0.0, 1.0};
87 GLfloat specular[] = {1.0, 1.0, 1.0, 1.0};
88 GLfloat shine = 100.0;
89 GLfloat glightmodel[] = {0.2,0.2,0.2,1};
90 GLfloat emission[] = {0.0, 0.3, 0.3, 1.0};
92 /* Zoom and rotate tracking */
93 GLfloat zoom = 0.0, rotate = 0.0, camAngle = 40.0;
94 GLfloat zoomFactor = 0.2, camRotateFactor = 0.5, camAngleFactor = 0.5;
95 GLfloat leftrightFactor = 0.5, nearfarFactor = 0.5, bigsmallFactor = 0.6, updownFactor = 0.03, rotateFactor = 0.8, texscaleFactor = 0.2;
97 /* Beginning width, height */
98 int width = 750, height = 750;
100 /* Texture state tracking */
101 int currentGroundTexture = 0, currentMeshTexture = 0;