WPI Computer Science Department

Computer Science Department
------------------------------------------

CS 543, Fall 2012 Homework 1, Due Tueday, September 25, 2012, emailed before class time


Homework 1 Overview

This project requires you to write a 2D program with fractals, keyboard controls and interaction.

Homework 1 Specifics

Step 1: Download and Compile the starter shader application : Download and unzip the following zip file [ Here ] . Visual Studio 10 is already installed on the Zoolab machines. Double-click on the Visual Studio file to open it Press Ctrl-F5 to compile and run the program. It should draw a triangle to the screen. If the triangle is drawn, you are all set! This program should run without problems on the Zoolab machines. VERY IMPORTANT NOTE: All your work must be done with this Visual Studio solution. The program requires a slightly different version of freeglut and glew than the one installed in the Zoolab machines. These versions of freeglut and glew have been included with this starter code. DO ALL YOUR WORK BY EXTENDING THE STARTER VISUAL STUDIO SOLUTION AND ASSOCIATED C++ FILES. DO NOT CREATE A NEW VISUAL STUDIO SOLUTION. SIMPLY MODIFY THE C++ FILES AND HEADERS SO THAT WHEN YOU ARE DONE, YOU WILL SIMPLY ZIP UP YOUR ENTIRE FOLDER AND SUBMIT THE ZIPPED SOLUTION.

The starter Visual Studio solution should also work on your home machine or any machine with adequate hardware. But again, I will help you on the Zoolab machines. WPI CCC machines. It's your responsibility to get things working on your home machine.

Step 2. Render the sierpinski Gasket: Modify the starter program given to you to draw the Sierpinski Gasket as explained in class. The code for the Sierpinski gasket is actually in your text.

Step 3. Modify the program so that it can read in and draw the following polyline files: The polyline files below are in the GRS format, a homegrown format:

dragon.dat
usa.dat
vinci.dat

The structure of GRS files is:

Step 4. Render the Hilbert Curve: Modify the starter program given to you to draw the Hilbert Curve as explained in class. Recursion is your friend for this part of your assignment. See the Hilbert Curve page at Mathworld for more information. Also see the wikipedia, it has a better explanation. This tutorial also has some useful information and may give you some ideas about how to apply different shapes and colors. Try to be creative.

Remember that what you are really doing, is replacing the "cup", the three-line segment, with four cups that are connected together with short lines. The new cups are one rotated counter clockwise, two in the same direction, then one rotated clockwise, all with lines connecting the end of one cup with the beginning of the next. Connectors are never changed, except that they will get smaller in length. It is the cups that get replaced with four new cups.

By default you should draw the Hilbert Curve iterated 3 times.

Summary of Your program behavior

After the practice, now re-organize your program to have the following behavior. When program starts as default, the Hilbert Curve (3 iterations) is drawn. Your program should then respond to the following key strokes Notes: No OpenGL fixed function commands (glBegin, glVertex, etc) or immediate mode drawing commands should be used in your program. All drawing should be done using shaders, retained mode, Vertex Buffer Objects, and glDrawArrays similar to the code in your textbook (and in the starter code)

Aspect ratio: You should maintain aspect ratio in all your drawings. This should be done initially whenever you draw a polyline for the first time. Also, implement a reshape function that recalculates the correct dimensions of the drawing whenever the user changes the current drawing Window dimensions.

Keyboard control: In order for your program to respond to keyboard strokes, you will need to write and register a keyboard callback function.

Submitting Your Work

Your final submission must be configured to work and fully tested in the Zoolab before submission. I will go to the zoolab to grade your project. Points will be docked for submissions that do not compile or require ANY modifications to compile. Use the starter package as provided to avoid porting problems at the end. Porting OpenGL code is non-trivial due to platform differences. Make sure to double-check that everything works before submitting. Submit all your executable and source files. Essentially, after your project is complete, just zip the starter solution folder. If the filesize is less than 20MB, you can email the file to emmanuel@cs.wpi.edu. If the final zip file is larger than 20MB, put it in a webspace and email me its URL.

Create documentation for your program and submit it along with the project inside the zip file. Your documentation can be either a pure ASCII text or Microsoft Word file. The documentation does not have to be long. Briefly describe the structure of your program, what each file turned in contains. Explain briefly what each module does and tie in your filenames. Most importantly, give clear instructions on how to compile and run your program. MAKE SURE IT RUNS before submission. Name your zip file according to the convention FirstName_lastName_hw1.zip


[Feedback] [Search Our Web] [Help & Index]

[Return to the WPI Homepage] [Return to CS Homepage]

mailto:emmanuel@cs.wpi.edu