WPI Computer Science Department

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

CS 543, Spring Semester 2018 Homework 1
Due Wednesday, February 7, 2018, by class time


Homework 1 Overview

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


Homework 1 Practice Steps

Step 1: Download and Compile the starter shader application : Download and run the starter code given to you in Project 0, part 3 [ Here ] . Visual Studio 2017 is already installed on the Zoolab machines. Double-click on the Visual Studio file to open it Compile and run the program. It should draw a triangle to the screen.

VERY IMPORTANT NOTE: 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 the TA and 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 Koch snowflake: Modify the starter program given to you to draw the Koch snowflake as explained in class. Recursion is your friend for this part of your assignment. See the Koch snowflake handout I gave out in class. When your program first renders the Koch snowflake, it should be iterated to level 3 (S3). But it should be possible to iterate the Koch snowflake to higher or lower levels (see below).

Summary of Required program behavior

After the practice, now re-organize your program to have the following behavior. When program starts as default, the Koch snowflake (3 iterations, S3) 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)

Koch snowflake Examples: Examples of iterations of the Koch snowflake are shown below:

Iteration 1 diagram

Aspect ratio: You should maintain aspect ratio in all your drawings. This should be done initially whenever you draw a polyline or Koch snowflake 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

Make sure to double-check that everything works before submitting. Submit all your executable and source files. Put all your work files (Visual Studio solution, OpenGL program, shaders, executable and input files into a folder and zip it. Essentially, after your project is complete, just zip the project directory created by Visual Studio. Submit your zip file using InstructAssist at [ https://ia.wpi.edu/cs543/] . Do not email me your program or submit it via dropbox. To make your submission smaller, delete the \ipch folder in the visual studio. On recompilation, Visual Studio will regenerate this folder without problems.

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 IN THE ZOOLAB before submission. Name your zip file according to the convention FirstName_lastName_hw1.zip

General Hints

Here are a more few hints you might find useful:


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

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

mailto:emmanuel@cs.wpi.edu