

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An assignment for a computer graphics course using opengl and glut. Students are required to set up a 3d opengl program, configure the perspective, and manipulate objects using matrices. The assignment involves rendering a 3d geometry into a window, setting up a projection matrix, and creating a cone with specific color requirements.
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!


Due: Wednesday, September 27th at 11:59 pm
Goal: Setup a 3D OpenGL program with perspective and simple geometry, and utilize matrices to manipulate objects.
Problem 1 (20 points): Write an OpenGL/GLUT program that renders 3D geometry into a 640 × 480 window.
Hint: The answer may not be your first thought. You can check your answer by comparing your answer with the matrix gluLookAt() creates. You can get this matrix by reading back the modelview matrix using the following code: GLfloat gluLookAtMatrix[16]; glMatrixMode(GL MODELVIEW); glLoadIdentity(); gluLookAt( <... fill in correct values ...> ); glGetFloatv(GL MODELVIEW MATRIX, gluLookAtMatrix ); printf("%f %f %f %f\n", gluLookAtMatrix[0], gluLookAtMatrix[4], < ...etc... >); printf("%f %f %f %f\n", gluLookAtMatrix[1], gluLookAtMatrix[5], < ...etc... >); < ...etc... >
Extra Credit (2 points): Why do the cones drawn in Parts G and H look strange? put the answer in your README. Fix the problem in your program, and add a keyboard callback (using the ’x’ key) to switch back and forth between the original and fixed versions. To get credit, the discontinuity apparent in the cones must go away.