
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 cmsc 427, a spring 2009 computer science course. Students are required to set up opengl, compile texture.cpp, and complete various tasks such as replacing a large quad with a grid of smaller quads, modifying quad coordinates, animating ripples, and rotating the quilt. The assignment includes instructions for compiling the code on windows and linux systems.
Typology: Assignments
1 / 1
This page cannot be seen from the preview
Don't miss anything!

CMSC 427, Spring 2009 Due 11:00am, Tuesday, Februrary 24, 2009 Maximum Score: 10 points
This assignment involves setting up OpenGL, texture mapping, procedurally defined models and animation.
Compiling the Startup Code In order to compile texture.cpp, you will need to set up the following include files:
#include <GL/glut.h> //openGL utilitiy toolkit #include <GL/gl.h> #include <GL/glu.h> #include <stdio.h> //for reading from file #include <math.h> //for trig functions
Visual Studio users can follow the instructions at http://www.cs.csustan.edu/~rsc/CS3600F01/InstallOpenGL.html In addition, Windows users will need
#include <windows.h> // make sure that <windows.h> comes before <glut.h>
#include <stdlib.h> #include <unistd.h>
You will also need to have the associated .lib files and .dll files for GLUT in a place where your compiler can find them.
Assignment Tasks
Get the program compiled and showing the quilt texture on a square facing the camera before making modifications to texture.cpp.
1. The quilt is currently mapped onto a single large quad. Replace this quad by a grid of smaller quads that cover the same area. The output after this step should look just the same: one large square facing the camera. To do this, you will need to review your notes about texture mapping coordinates. (2.5 points) 2. Modify the coordinates of the small quads so that the quilt has ripples or waves. (You will need to use a
trignometric function for this.) (2.5 points)
3. Animate the ripples, so that the quilt waves over time. (2.5 points) 4. Rotate the quilt in various directions so that the user can see it from all different sides. (2.5 points)
Most of your changes will be made in the “display” function, which is run again and again in a loop. But you will probably need to add some global variables that maintain their state between runs of this function. (If you feel global variables are inelegant, feel free to do it another way.)
Submit your final texture.cpp file (well commented, please, including your name at the top) electronically.
You can discuss this assignment with others but all the code that you turn in must be your own and not based on
anyone else’s work.