/** FinalProject.cpp
*
* Created on: Dec 10, 2019
* Author: esmeralda.mon_snhu
*
* –3D Chair-*/
/*Header Inclusions*/
#include
#include
#include
//GLM Math Header Inclusions */
#include
#include
#include
using namespace std; //Standard namespace
/*Used Functions*/
void UMouseMove(int x, int y);
void processSpecialKeys(int key, int xx, int yy);
#define WINDOW_TITLE “Final Project Chair Monteparo” //Window title Macro
//Scaling of the object
GLfloat scale_by_y = 2.0f;
GLfloat scale_by_z = 2.0f;
GLfloat scale_by_x = 2.0f;
int viewType = 1; //Ortho view = 1, Perspective = 0
GLfloat lastMouseX = 400, lastMouseY = 300; //Locks mouse cursor at the center of the screen
GLfloat sumX = 0, sumY = 0;
GLfloat mouseXoffset, mouseYoffset , yaw = 0.0f ,pitch = 0.0f; //Mouse offset, yaw and pitch
variables
GLfloat sensitivity = 0.01f; //Used for mouse and camera sensitivity
GLint WindowWidth = 800, WindowHeight = 800;
//Angle of rotation for the camera direction
float angle = 0.0;
//Actual vector representing the camera’s direction
float lx = 0.0f, lz = 0.0f;
//XZ position of the camera
float x = 0.0f, z = 0.0f;
//Camera position
float cam_x = 0.0f;
float cam_y = 0.0f;
float cam_z = -1.0f;
//Initializes 3D rendering
void initRendering(){
glEnable(GL_DEPTH_TEST);
glEnable(GL_COLOR_MATERIAL);
glEnable(GL_LIGHTING); //Enable lighting
glEnable(GL_LIGHT0); //Enable light
glEnable(GL_LIGHT1); //Enable light
glEnable(GL_NORMALIZE); //Automatically normalize normals
glShadeModel(GL_SMOOTH); //Enable smooth shading
}
//Called when the window is resized
void handleResize(int w, int h){
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
WindowWidth = w;
WindowHeight = h;
glViewport(0.0f, 0.0f, WindowWidth, WindowHeight);
}
float _angle = -70.0f;
//Draws 3D sequence
void drawChair(){
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
//Goes between orthogonal/perspective view
if(viewType == 1){
//Perspective
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(75.0, (GLfloat)WindowWidth / (GLfloat)WindowHeight, 0.1f,
100.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
else if(viewType == 0){
//Orthogonal
glMatrixMode (GL_PROJECTION);
glLoadIdentity();
glOrtho(-5.0f, 5.0f, -5.0f ,5.0f, 0.1f, 100.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
glTranslatef(0.0f, 0.0f, -14.0f);
gluLookAt(cam_x, cam_y, cam_z, x, 0.0f, z, x+lx, 1.0f, z+lz);
//Allow for zooming in and out
glScalef(scale_by_x, scale_by_y, scale_by_z);
//Add ambient light
GLfloat ambientColor[] = {0.5f, 0.5f, 0.5f, 1.0f}; //Color (0.5, 0.5, 0.5)
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambientColor);
//Add positioned light
GLfloat lightColor0[] = {1.0f, 1.0f, 1.0f, 1.0f}; //Color (1.0, 1.0, 1.0)
GLfloat lightPos0[] = {0.0f, -8.0f, 8.0f, 1.0f}; //Positioned at (4, 0, 8)
glLightfv(GL_LIGHT0, GL_DIFFUSE, lightColor0);
glLightfv(GL_LIGHT0, GL_POSITION, lightPos0);
//Add directed light
GLfloat lightColor1[] = {0.5f, 0.2f, 0.2f, 1.0f}; //Color (0.5, 0.2, 0.2)
GLfloat lightPos1[] = {-1.0f, 0.5f, 0.5f, 0.0f}; //Coming from the direction (-1, 0.5, 0.5)
glLightfv(GL_LIGHT1, GL_DIFFUSE, lightColor1);
glLightfv(GL_LIGHT1, GL_POSITION, lightPos1);
glRotatef(10, 1.0f, 0.0f, 0.0f);
glRotatef(-10, 0.0f, 0.0f, 1.0f);
glRotatef(_angle, 0.0f, 1.0f, 0.0f);
//Add green color to seat
glColor3f(0.0f, 1.0f, 0.0f);
glBegin(GL_QUADS);
//Front
glNormal3f(0.0f, 0.0f, 1.0f);
glVertex3f(-1.8f, -0.2f, 2.0f);
glVertex3f(1.8f, -0.2f, 2.0f);
glVertex3f(1.8f, 0.2f, 2.0f);
glVertex3f(-1.8f, 0.2f, 2.0f);
//Right
glNormal3f(1.0f, 0.0f, 0.0f);
glVertex3f(1.8f, -0.2f, -2.0f);
glVertex3f(1.8f, 0.2f, -2.0f);
glVertex3f(1.8f, 0.2f, 2.0f);
glVertex3f(1.8f, -0.2f, 2.0f);
//Back
glNormal3f(0.0f, 0.0f, -1.0f);
glVertex3f(-1.8f, -0.2f, -2.0f);
glVertex3f(-1.8f, 0.2f, -2.0f);
glVertex3f(1.8f, 0.2f, -2.0f);
glVertex3f(1.8f, -0.2f, -2.0f);
//Left
glNormal3f(-1.0f, 0.0f, 0.0f);
glVertex3f(-1.8f, -0.2f, -2.0f);
glVertex3f(-1.8f, -0.2f, 2.0f);
glVertex3f(-1.8f, 0.2f, 2.0f);
glVertex3f(-1.8f, 0.2f, -2.0f);
//Top
glNormal3f(0.0f, 1.0f, 0.0f);
glVertex3f(1.8f, 0.2f, 2.0f);
glVertex3f(-1.8f, 0.2f, 2.0f);
glVertex3f(-1.8f, 0.2f, -2.0f);
glVertex3f(1.8f, 0.2f, -2.0f);
//Bottom
glNormal3f(0.0f, -1.0f, 0.0f);
glVertex3f(1.8f, -0.2f, 2.0f);
glVertex3f(-1.8f, -0.2f, 2.0f);
glVertex3f(-1.8f, -0.2f, -2.0f);
glVertex3f(1.8f, -0.2f, -2.0f);
glColor3f(1.0f, 0.0f, 0.0f); //Add red color to legs
//Front right leg
//front
glNormal3f(0.0f, 0.0f, 1.0f);
glVertex3f(1.8f, -0.2f, 1.6f);
glVertex3f(1.4f, -0.2f, 1.6f);
glVertex3f(1.4f, -3.0f, 1.6f);
glVertex3f(1.8f, -3.0f, 1.6f);
//back
glNormal3f(0.0f, 0.0f, -1.0f);
glVertex3f(1.8f, -0.2f, 1.2f);
glVertex3f(1.4f, -0.2f, 1.2f);
glVertex3f(1.4f, -3.0f, 1.2f);
glVertex3f(1.8f, -3.0f, 1.2f);
//right
glNormal3f(1.0f, 0.0f, 0.0f);
glVertex3f(1.8f, -0.2f, 1.6f);
glVertex3f(1.8f, -0.2f, 1.2f);
glVertex3f(1.8f, -3.0f, 1.2f);
glVertex3f(1.8f, -3.0f, 1.6f);
//left
glNormal3f(-1.0f, 0.0f, 0.0f);
glVertex3f(1.4f, -0.2f, 1.6f);
glVertex3f(1.4f, -0.2f, 1.2f);
glVertex3f(1.4f, -3.0f, 1.2f);
glVertex3f(1.4f, -3.0f, 1.6f);
//Back right leg
//front
glNormal3f(0.0f, 0.0f, -1.0f);
glVertex3f(1.8f, -0.2f, -1.2f);
glVertex3f(1.4f, -0.2f, -1.2f);
glVertex3f(1.4f, -3.0f, -1.2f);
glVertex3f(1.8f, -3.0f, -1.2f);
//back
glNormal3f(0.0f, 0.0f, -1.0f);
glVertex3f(1.8f, -0.2f, -1.6f);
glVertex3f(1.4f, -0.2f, -1.6f);
glVertex3f(1.4f, -3.0f, -1.6f);
glVertex3f(1.8f, -3.0f, -1.6f);
//right
glNormal3f(1.0f, 0.0f, 0.0f);
glVertex3f(1.8f, -0.2f, -1.6f);
glVertex3f(1.8f, -0.2f, -1.2f);
glVertex3f(1.8f, -3.0f, -1.2f);
glVertex3f(1.8f, -3.0f, -1.6f);
//left
glNormal3f(1.0f, 0.0f, 0.0f);
glVertex3f(1.4f, -0.2f, -1.6f);
glVertex3f(1.4f, -0.2f, -1.2f);
glVertex3f(1.4f, -3.0f, -1.2f);
glVertex3f(1.4f, -3.0f, -1.6f);
//Left front leg
//front
glNormal3f(0.0f, 0.0f, 1.0f);
glVertex3f(-1.8f, -0.2f, 1.6f);
glVertex3f(-1.4f, -0.2f, 1.6f);
glVertex3f(-1.4f, -3.0f, 1.6f);
glVertex3f(-1.8f, -3.0f, 1.6f);
//back
glNormal3f(0.0f, 0.0f, -1.0f);
glVertex3f(-1.8f, -0.2f, 1.2f);
glVertex3f(-1.4f, -0.2f, 1.2f);
glVertex3f(-1.4f, -3.0f, 1.2f);
glVertex3f(-1.8f, -3.0f, 1.2f);
//right
glNormal3f(1.0f, 0.0f, 0.0f);
glVertex3f(-1.8f, -0.2f, 1.6f);
glVertex3f(-1.8f, -0.2f, 1.2f);
glVertex3f(-1.8f, -3.0f, 1.2f);
glVertex3f(-1.8f, -3.0f, 1.6f);
//left
glNormal3f(-1.0f, 0.0f, 0.0f);
glVertex3f(-1.4f, -0.2f, 1.6f);
glVertex3f(-1.4f, -0.2f, 1.2f);
glVertex3f(-1.4f, -3.0f, 1.2f);
glVertex3f(-1.4f, -3.0f, 1.6f);
//Left back leg
//front
glNormal3f(0.0f, 0.0f, -1.0f);
glVertex3f(-1.8f, -0.2f, -1.2f);
glVertex3f(-1.4f, -0.2f, -1.2f);
glVertex3f(-1.4f, -3.0f, -1.2f);
glVertex3f(-1.8f, -3.0f, -1.2f);
//back
glNormal3f(0.0f, 0.0f, -1.0f);
glVertex3f(-1.8f, -0.2f, -1.6f);
glVertex3f(-1.4f, -0.2f, -1.6f);
glVertex3f(-1.4f, -3.0f, -1.6f);
glVertex3f(-1.8f, -3.0f, -1.6f);
//right
glNormal3f(1.0f, 0.0f, 0.0f);
glVertex3f(-1.8f, -0.2f, -1.6f);
glVertex3f(-1.8f, -0.2f, -1.2f);
glVertex3f(-1.8f, -3.0f, -1.2f);
glVertex3f(-1.8f, -3.0f, -1.6f);
//left
glNormal3f(-1.0f, 0.0f, 0.0f);
glVertex3f(-1.4f, -0.2f, -1.6f);
glVertex3f(-1.4f, -0.2f, -1.2f);
glVertex3f(-1.4f, -3.0f, -1.2f);
glVertex3f(-1.4f, -3.0f, -1.6f);
//Left legs connector
//right
glNormal3f(1.0f, 0.0f, 0.0f);
glVertex3f(-1.8f, -1.5f, 1.2f);
glVertex3f(-1.8f, -1.5f, -1.2f);
glVertex3f(-1.8f, -1.7f, -1.2f);
glVertex3f(-1.8f, -1.7f, 1.2f);
//left
glNormal3f(-1.0f, 0.0f, 0.0f);
glVertex3f(-1.4f, -1.5f, 1.2f);
glVertex3f(-1.4f, -1.5f, -1.2f);
glVertex3f(-1.4f, -1.7f, -1.2f);
glVertex3f(-1.4f, -1.7f, 1.2f);
//top
glNormal3f(-1.0f, 0.0f, 0.0f);
glVertex3f(-1.8f, -1.5f, 1.2f);
glVertex3f(-1.8f, -1.5f, -1.2f);
glVertex3f(-1.4f, -1.5f, -1.2f);
glVertex3f(-1.4f, -1.5f, 1.2f);
//bottom
glNormal3f(-1.0f, 0.0f, 0.0f);
glVertex3f(-1.8f, -1.7f, 1.2f);
glVertex3f(-1.8f, -1.7f, -1.2f);
glVertex3f(-1.4f, -1.7f, -1.2f);
glVertex3f(-1.4f, -1.7f, 1.2f);
//Center connector
//front
glNormal3f(1.0f, 0.0f, 0.0f);
glVertex3f(-1.4f, -1.5f, 0.6f);
glVertex3f(1.4f, -1.5f, 0.6f);
glVertex3f(1.4f, -1.7f, 0.6f);
glVertex3f(-1.4f, -1.7f, 0.6f);
//back
glNormal3f(-1.0f, 0.0f, 0.0f);
glVertex3f(-1.4f, -1.5f, 0.2f);
glVertex3f(1.4f, -1.5f, 0.2f);
glVertex3f(1.4f, -1.7f, 0.2f);
glVertex3f(-1.4f, -1.7f, 0.2f);
//top
glNormal3f(-1.0f, 0.0f, 0.0f);
glVertex3f(-1.4f, -1.5f, 0.6f);
glVertex3f(-1.4f, -1.5f, 0.2f);
glVertex3f(1.4f, -1.5f, 0.2f);
glVertex3f(1.4f, -1.5f, 0.6f);
//bottom
glNormal3f(-1.0f, 0.0f, 0.0f);
glVertex3f(-1.4f, -1.7f, 0.6f);
glVertex3f(-1.4f, -1.7f, 0.2f);
glVertex3f(1.4f, -1.7f, 0.2f);
glVertex3f(1.4f, -1.7f, 0.6f);
//Right legs connector
//right
glNormal3f(1.0f, 0.0f, 0.0f);
glVertex3f(1.8f, -1.5f, 1.2f);
glVertex3f(1.8f, -1.5f, -1.2f);
glVertex3f(1.8f, -1.7f, -1.2f);
glVertex3f(1.8f, -1.7f, 1.2f);
//left
glNormal3f(1.0f, 0.0f, 0.0f);
glVertex3f(1.4f, -1.5f, 1.2f);
glVertex3f(1.4f, -1.5f, -1.2f);
glVertex3f(1.4f, -1.7f, -1.2f);
glVertex3f(1.4f, -1.7f, 1.2f);
//top
glNormal3f(1.0f, 0.0f, 0.0f);
glVertex3f(1.8f, -1.5f, 1.2f);
glVertex3f(1.8f, -1.5f, -1.2f);
glVertex3f(1.4f, -1.5f, -1.2f);
glVertex3f(1.4f, -1.5f, 1.2f);
//bottom
glNormal3f(1.0f, 0.0f, 0.0f);
glVertex3f(1.8f, -1.7f, 1.2f);
glVertex3f(1.8f, -1.7f, -1.2f);
glVertex3f(1.4f, -1.7f, -1.2f);
glVertex3f(1.4f, -1.7f, 1.2f);
glColor3f(0.0f, 0.0f, 1.0f); //Add blue color to chair back
//Backing of chair
//front
glVertex3f(-1.8f, 1.25f, -1.8f);
glVertex3f(1.8f, 1.25f, -1.8f);
glVertex3f(2.5f, 3.5f, -1.8f);
glVertex3f(-2.5f, 3.5f, -1.8f);
//lower center portion
glVertex3f(-1.0f, 0.2f, -1.8f);
glVertex3f(1.0f, 0.2f, -1.8f);
glVertex3f(1.7f, 3.5f, -1.8f);
glVertex3f(-1.7f, 3.5f, -1.8f);
glVertex3f(-1.0f, 0.2f, -2.0f);
glVertex3f(1.0f, 0.2f, -2.0f);
glVertex3f(1.7f, 3.5f, -2.0f);
glVertex3f(-1.7f, 3.5f, -2.0f);
glVertex3f(-1.0f, 0.2f, -2.0f);
glVertex3f(-1.7f, 3.5f, -2.0f);
glVertex3f(-1.7f, 3.5f, -1.8f);
glVertex3f(-1.0f, 0.2f, -1.8f);
glVertex3f(1.0f, 0.2f, -2.0f);
glVertex3f(1.7f, 3.5f, -2.0f);
glVertex3f(1.7f, 3.5f, -1.8f);
glVertex3f(1.0f, 0.2f, -1.8f);
//back
glVertex3f(-1.8f, 1.25f, -2.0f);
glVertex3f(1.8f, 1.25f, -2.0f);
glVertex3f(2.5f, 3.5f, -2.0f);
glVertex3f(-2.5f, 3.5f, -2.0f);
glVertex3f(-1.8f, 1.25f, -2.0f);
glVertex3f(-2.5f, 3.5f, -2.0f);
glVertex3f(-2.5f, 3.5f, -1.8f);
glVertex3f(-1.8f, 1.25f, -1.8f);
glVertex3f(1.8f, 1.25f, -2.0f);
glVertex3f(2.5f, 3.5f, -2.0f);
glVertex3f(2.5f, 3.5f, -1.8f);
glVertex3f(1.8f, 1.25f, -1.8f);
glVertex3f(-2.5f, 3.5f, -2.0f);
glVertex3f(-2.5f, 3.5f, -1.8f);
glVertex3f(2.5f, 3.5f, -1.8f);
glVertex3f(2.5f, 3.5f, -2.0f);
glEnd();
glutSwapBuffers();
}
void update(int value){
if (_angle > 360){
_angle -= 360;
}
glutPostRedisplay();
glutTimerFunc(25, update, 0);
}
void UMouseMove(int curr_x , int curr_y){
//Change camera position
cam_x = 10.0f * cos(yaw);
cam_y = 10.0f * sin(pitch);
cam_z = sin(yaw) * cos(pitch) * 10.0f;
//Gets the direction the mouse was moved
mouseXoffset = curr_x – lastMouseX;
mouseYoffset = lastMouseY – curr_y;
//Updates with new mouse coordinates
lastMouseX = curr_x;
lastMouseY = curr_y;
//Applies sensitivity to mouse direction
mouseXoffset *= sensitivity;
mouseYoffset *= sensitivity;
//Gets the direction of the mouse
//If changes in yaw, then move along X
if(yaw != yaw+mouseXoffset && pitch == pitch+mouseYoffset){
//Increment yaw
yaw += mouseXoffset;
} //Else move in y
else if(pitch != pitch+mouseYoffset && yaw == yaw+mouseXoffset ){
//Increment y to move vertically
pitch += mouseYoffset;
}
//Maintains a 90 degree pitch for gimbal lock
if(pitch > 89.0f ){
pitch = 89.0f;
}
if(pitch < -89.0f ){
pitch = -89.0f;
}
//Update camera position
cam_x = 5.0f * cos(yaw);
cam_y = 5.0f * sin(pitch);
cam_z = sin(yaw) * cos(pitch) * 10.0f;
}
void processSpecialKeys(int key, int xx, int yy){
//Used for object zoom
switch (key){
//Object zoom out
case GLUT_KEY_UP:
scale_by_y += 0.1f;
scale_by_x += 0.1f;
scale_by_z += 0.1f;
break;
//Object zoom in
case GLUT_KEY_DOWN:
scale_by_y -= 0.1f;
scale_by_x -= 0.1f;
scale_by_z -= 0.1f;
break;
//Change view to orthogonal
case GLUT_KEY_LEFT:
viewType = 0;
break;
//Change view to perspective
case GLUT_KEY_RIGHT:
viewType = 1;
break;
}
}
//Main method
int main(int argc, char** argv){
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(600, 600);
//Create the window
glutCreateWindow("Final Project Chair Monteparo");
initRendering();
//Set handler functions
glutDisplayFunc(drawChair);
glutReshapeFunc(handleResize);
glutPassiveMotionFunc(UMouseMove);
glutSpecialFunc(processSpecialKeys);
update(0);
glutMainLoop();
return 0;
}
CS 330 Final Project Guidelines and Rubric
Overview
The creation of computational graphics and visualizations is a skill in growing demand. These skills are applicable to the following scenarios: the game industry
for creating graphics and animations, the healthcare industry for medical visualizations, the entertainment industry for computer-generated imagery (CGI) and
visual effects, 3D printing for creating physical objects for applied real-world problem solving, and much more. Throughout this course, you will learn how to
write computer code that commands any OpenGL graphics processing unit (GPU) to create, texture, light, render, and animate 3D models in 3D space, and
control virtual environments relative to a virtual camera.
This assessment addresses the following course outcomes:
Generate accurate representations of three-dimensional objects using application programming interface (API) libraries and computer graphics
development best practices
Create interactive graphics applications that respond to input devices allowing for successful navigation around three-dimensional objects and through
three-dimensional space
Employ best practices in formatting, commenting, and functional logic that produce reliable computer programs
Defend computer graphic and program development decisions for their effectiveness in meeting project requirements
Prompt
Your commented code and reflection for this project will demonstrate the skills you have gained creating 3D graphics and the principles discussed in the course.
To complete this project, you will select a real-world object (personal item, commercial product, etc.) and create a three-dimensional representation of it. You
will create a digitally lit, fully textured 3D object that can be orbited using a virtual camera and mouse controls. In addition, you will reflect on this project by
providing documentation explaining how the graphics were created and write about how you applied each step in the OpenGL pipeline. You will also reflect on
any challenges that influenced your coding/development decisions.
Personal object selection: To minimize complexity and save 3D modeling time, the polygon count for your objects should not exceed 1,000 triangles. While you
may want to choose a more complex object, to complete the project within the time constraints of the course, the number of triangles must be limited. Below
are examples of objects that can be created using a low polygon count. Please choose from one of these categories:
1
Furniture (chair or table)
Kitchen appliances (spoon, knife, cup, not a kettle)
Body wash container
Animal head sculpture (not a monkey head sculpture)
Note: When using images for textures, make sure you are using royalty-free images with resolutions of 1024 x 1024 pixels or higher.
Specifically, your project must address the following critical elements:
I.
3D Object
A. Your 3D object will be assessed visually to ensure it meets the elements below:
i.
Utilize organized geometry, ensuring that polygons (triangles) on the 3D model are well spaced and connected and give a low-polygon
representation of a real-world object.
ii.
Utilize textures, ensuring that high-resolution textures are projected accurately on the 3D model.
iii.
Generate lighting, ensuring that all lights are implemented to give a professional-looking presentation and visualization of the model.
iv.
Apply color to lighting with varying intensities.
B. Navigation Through Input Devices: Your applications will be navigated by using the mouse and keyboard input devices to control a virtual
camera. The elements below must be met:
i.
Create horizontal orientation navigation of the 3D object in the application allowing for azimuth orientation of a virtual camera that
orbits a lit model when the mouse is moved horizontally.
ii.
Create vertical orientation navigation of the 3D object in the application allowing for altitude orientation of a virtual camera that orbits
a lit model when the mouse is moved vertically.
iii.
Create code to clamp or gimbal lock azimuth and altitude orientation to prevent irregular camera angles (e.g., a 90-degree camera
rotation clamp on the pitch axis).
iv.
Create perspective and orthographic displays of the 3D object so that the user can change the viewport display of the 3D model from
2D to 3D and vice versa, using the tap of a keyboard key, allowing the user to switch between orthographic (2D) and perspective (3D)
views at will.
C. Syntax Assessment—Best Practices: These best practices should be evident within your program:
i.
Employ formatting best practices by providing program code that is easy to read and follows industry-standard code formatting
practices, such as indentation and spacing.
ii.
Utilize commenting best practices, ensuring that project source code used is briefly and clearly explained using descriptive comments.
iii.
Employ functional coding logic best practices, ensuring that the program runs as expected.
2
II.
Reflection
A. Justify development choices for your object. Why did you choose your selected object? Were you able to program for the functionality
required?
B. Explain how a user can navigate your 3D object. Explain how you set up the virtual camera for your 3D object and the programming syntax you
used to control its navigation using the input devices.
C. Explain the custom functions in your program that you are using to make your code more modular and organized (what does the function do
and how is it reusable?).
Milestones
Your work on the final project is supported by two milestones.
Milestone One: Project Proposal
In Module Three, you will propose a real-world object to model in your project, submit a photograph of it, and discuss how you will re-create it as a 3D object in
modern OpenGL, following the parameters established for the final project. This milestone will be graded with the Milestone One Rubric.
Milestone Two: Project Draft
In Module Five, you will submit a draft of the final project, including all the aspects of graphics development covered up to this point in the course. This is an
important opportunity to try out your skills and receive valuable feedback as you prepare for the final project submission. This milestone will be graded with the
Milestone Two Rubric.
Final Submission: Commented Code and Reflection
In Module Seven, you will submit your final project. It should be a complete, polished artifact containing all of the critical elements of the final product. It should
reflect the incorporation of feedback gained throughout the course. This submission will be graded with the Final Project Rubric.
3
Rubric
Guidelines for Submission: Submit a commented .cpp file for the 3D object. Also submit a reflection, which should be 1–2 pages using 12-point Times New
Roman font and double spacing. Any citations should be in APA format.
Critical Elements
3D Object: Organized
Geometry
Exemplary (100%)
Meets “Proficient” criteria and
demonstrates a sophisticated
use of geometry in the 3D
object
3D Object: Textures
Meets “Proficient” criteria and
demonstrates a sophisticated
use of texture on the 3D model
3D Object: Lighting
Meets “Proficient” criteria and
demonstrates an advanced
application of lighting on the
3D object
3D Object: Color
Meets “Proficient” criteria and
demonstrates a sophisticated
use of types of color, tone, and
intensity in lighting
Meets “Proficient” criteria and
demonstrates a sophisticated
use of horizontal orientation
control
Navigation:
Horizontal
Orientation
Proficient (85%)
Utilizes organized geometry,
ensuring that polygons are well
spaced and connected while
keeping the polygon count
moderate
Utilizes textures, ensuring that
high-resolution textures are
projected accurately on the 3D
model
Generates lighting, ensuring
that all lighting is implemented
for a professional presentation
and visualization of the model
Applies color to lighting with
varying intensities
Creates horizontal orientation
navigation of 3D object
allowing for azimuth
orientation of a virtual camera
that orbits the model when the
mouse is moved horizontally
4
Needs Improvement (55%)
Utilizes organized geometry,
but with errors in ensuring that
polygons are well spaced and
connected while keeping the
polygon count moderate
Utilizes textures to ensure that
high-resolution textures are
projected on the 3D model, but
contains some inaccuracies
Generates lighting, ensuring
that all lighting is implemented
for a professional presentation
and visualization of the model,
but with errors
Applies color to lighting, but
with errors
Not Evident (0%)
Does not utilize organized
geometry ensuring that
polygons are well-spaced and
connected while keeping the
polygon count moderate
Does not utilize textures to
ensure that high-resolution
textures are projected
accurately on the 3D model
Does not generate lighting
ensuring that all lighting is
implemented for a professional
presentation and visualization
of the model
Does not apply color to lighting
Value
5.94
Creates horizontal orientation
navigation of 3D object
allowing for azimuth
orientation of a virtual camera
that orbits the model when the
mouse is moved horizontally,
but with errors
Does not create horizontal
orientation navigation of 3D
object allowing for azimuth
orientation of a virtual camera
that orbits the model when the
mouse is moved horizontally
5.94
5.94
5.94
5.94
Navigation: Vertical
Orientation
Meets “Proficient” criteria and
demonstrates a sophisticated
use of vertical orientation
control
Creates vertical orientation
navigation of 3D object
allowing for altitude orientation
of a virtual camera that orbits
the model when the mouse is
moved vertically
Navigation: Clamp
Meets “Proficient” criteria and
demonstrates a sophisticated
use of angle control due to
clamping
Creates code to clamp azimuth
and altitude orientation to
prevent irregular camera angles
Navigation:
Perspective and
Orthographic
Displays
Syntax: Formatting
Best Practices
Syntax: Commenting
Code
Syntax: Functional
Logic
Creates perspective and
orthographic displays of 3D
object so that the user can
change the viewport display of
the 3D model from 3D to 2D
using the keyboard
Meets “Proficient” criteria and
demonstrates a sophisticated
awareness of industry best
practices in formatting
Meets “Proficient” criteria and
demonstrates keen insight into
best practices in commenting
code
Provides program code that is
easy to read and follows
formatting best practices as
defined by the industry
Utilizes commenting best
practices, ensuring that project
source code used is briefly and
clearly explained using
descriptive comments
Meets “Proficient” criteria and
demonstrates keen insight into
best practices in functional
logic
Employs functional coding logic
best practices, ensuring that
program runs as expected
5
Creates vertical orientation
navigation of 3D object
allowing for altitude orientation
of a virtual camera that orbits
the model when the mouse is
moved vertically, but with
errors
Creates code to clamp azimuth
and altitude orientation to
prevent irregular camera
angles, but with errors
Creates perspective and
orthographic displays of 3D
object so that the user can
change the viewport display of
the 3D model from 3D to 2D
using the keyboard, but with
errors
Provides program code that is
easy to read, but follows only
some formatting best practices
Utilizes commenting best
practices, ensuring that project
source code used is explained
using descriptive comments,
but comments lack detail or
clarity
Employs functional coding logic
best practices, ensuring that
program runs, but with errors
Does not create vertical
orientation navigation of 3D
object allowing for altitude
orientation of a virtual camera
that orbits the model when the
mouse is moved vertically
5.94
Does not create code to clamp
azimuth and altitude
orientation to prevent irregular
camera angles
Does not create perspective
and orthographic displays of 3D
object so that the user can
change the viewport display of
the 3D model from 3D to 2D
using the keyboard
5.94
Does not provide program code
that is easy to read or does not
follow any formatting best
practices
Does not utilize commenting
best practices to explain project
source code
7.92
Does not employ functional
coding logic best practices
7.92
5.94
7.92
Reflection:
Development Choices
Meets “Proficient” criteria and
demonstrates a keen insight
into development choices for
this project
Justifies development choices
of the 3D object and explains
how the required functionality
was achieved
Reflection: User Can
Navigate
Meets “Proficient” criteria and
demonstrates a nuanced
understanding of user
navigation
Explains how the user can
navigate the 3D object, the
setup of the virtual cameras, as
well as the programming syntax
used for the input devices
Reflection: Custom
Functions
Meets “Proficient” criteria and
demonstrates a nuanced
understanding of the program
functions
Explains the custom functions
used in the program, what they
do, and how they are reusable
Articulation of
Response
Submission is free of errors
related to citations, grammar,
spelling, syntax, and
organization and is presented
in a professional and easy-toread format
Submission has no major errors
related to citations, grammar,
spelling, syntax, or organization
6
Justifies development choices
of the 3D object and explains
how the required functionality
was achieved, but justification
and explanation lack detail or
clarity
Explains how the user can
navigate the 3D object, the
setup of the virtual cameras, as
well as the programming syntax
used for the input devices, but
explanation lacks detail or
clarity
Explains the custom functions
used in the program, what they
do, and how they are reusable,
but explanation lacks clarity or
detail
Submission has major errors
related to citations, grammar,
spelling, syntax, or organization
that negatively impact
readability and articulation of
main ideas
Does not justify development
choices or explain how the
required functionality was
achieved
7.92
Does not explain how the user
will navigate the 3D object, the
setup of the virtual cameras, as
well as the programming syntax
used for the input devices
7.92
Does not explain the custom
functions used in the program,
what they do, and how they are
reusable
7.92
Submission has critical errors
related to citations, grammar,
spelling, syntax, or organization
that prevent understanding of
ideas
4.96
Total
100%