glDisable(GL_BLEND);
glEnable(GL_LIGHTING);
glEnable(GL_TEXTURE_2D);
+}
+
+void addSceneObject(int id) {
+ // **NOTE: Currently only adds the teapot
+
+ nObjects += 1; // New object in scene
+
+ sceneObjs[nObjects].mesh = -1;
+ sceneObjs[nObjects].texture = -1;
+ sceneObjs[nObjects].x = 0;
+ sceneObjs[nObjects].y = 0;
+ sceneObjs[nObjects].z = 0;
+
+ sceneObjs[nObjects].scale = (vector*)calloc( 3, sizeof(vector[0]) );
+
+ sceneObjs[nObjects].rotation.parameter = 0;
+ sceneObjs[nObjects].rotation.vect = (vector*)calloc( 3, sizeof(vector[0]) );
}
\ No newline at end of file
void drawFloor();
void drawAxisLines();
+void addSceneObject(int id);
+
#endif /* HELPER_H */
* @param id ID of object selected\r
*/\r
void processObjectEvents(int id) {\r
-\r
+ // **NOTE: For the testing phase, only have the teapot\r
+ addSceneObject(id);\r
}\r
\r
/**\r
glLightfv(GL_LIGHT0, GL_SPOT_DIRECTION, direction0);\r
\r
//glLightf(GL_LIGHT0, GL_SPOT_CUTOFF, 90.0);\r
- glLighti(GL_LIGHT0, GL_SPOT_EXPONENT,100);\r
+ //glLighti(GL_LIGHT0, GL_SPOT_EXPONENT,100);\r
\r
glLightfv(GL_LIGHT1, GL_AMBIENT, ambient1);\r
glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuse1);\r
glLightfv(GL_LIGHT1, GL_SPOT_DIRECTION, direction1);\r
\r
//glLightf(GL_LIGHT1, GL_SPOT_CUTOFF, 90.0);\r
- glLighti(GL_LIGHT1, GL_SPOT_EXPONENT,100);\r
+ //glLighti(GL_LIGHT1, GL_SPOT_EXPONENT,100);\r
\r
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, glightmodel);\r
glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);\r
GLubyte *rgbData; // Array of bytes with the colour data for the texture
} texture;
+
+typedef GLfloat vector[3]; // Vector datatyle
+
+typedef struct {
+ GLfloat parameter; // Transform amount
+ vector* vect; // Transform vector
+} transform;
+
typedef struct {
- // You'll need to add scale, rotation, material, mesh number, etc.,
- // to this structure
- float x,y,z;
+ int mesh; // Mesh index number
+ int texture; // Texture index number
+ float x,y,z; // Scene position
+ vector* scale; // Scale vector
+ transform rotation; // Rotation transformation
} SceneObject;
// Menu enum