CSCI 441 - Computer Graphics

Fall 2016 - Assignment 4 - How to Train Your Pegasus



|   Home |  Syllabus |  Assignments |  Leaderboard |  Schedule |  Resources   |
This assignment is due by Friday, September 30, 2016 by 11:59pm.

Traveling must faster than you had been, thanks to your new transport, you begin to see the faint outline of a large city on the horizon. This immediately lifts your spirits and you quicken your pace. As the city grows larger, you can begin to make out individual buildings and it appears the city is divided into very distinct regions.

Suddenly, you come to a halt. Blocking the road is a small creature stuck in a trap. It begins speaking to you, directly into your mind it seems.
"Please help me kind Hero. Set me free and I will guide & protect you where ever you go."


Part I - Set the Creature Free


You fiddle with the trap a bit, and the mechanism releases. Suddenly, the creature begins floating and flying around you. You spin to keep an eye on it, but its movement is too quick for you. As the creature moves faster and faster you begin to hear it speaking to you directly in your mind:
For this assignment, you will use your Assignment 3 submission as the starting point and add to it. Following the same format as Lab03, you will read in control points from a file. With your submission, you must include a control point file that specifies the Bézier curves for your submission. We will later test with an additional control point file for completeness and accuracy. All curves you submit will be C0 continuous by definition, but can it be C1 continuous as well?

As before, your program must feature a grid and scenery of some sort to provide the user with a sense of scale and perspective. Your hero will still be moving around the world as before. Now, there will be a Bézier curve(s) centered around your hero. You must plot the "control cage," the edges between control points, with a light yellow line, and plot the Bézier curve itself with a blue line. You must also draw small, solid green spheres at the control points. As your hero moves around the world, the curve should move with the hero so the hero is always at the center of where the curve is drawn around.

Finally, animate a pet/spirit/sprite/fairy/etc. that continuously moves along the curve. When the pet reaches the end of the curve, have it jump to the beginning of the curve and repeat indefinitely (unless the end of your curve is the beginning of your curve, what happens then?). Your pet should be drawn hierarchically and animated while it moves just as your hero does. Therefore, even if your hero is standing still, your pet should still be in constant motion along the curve.

The camera can follow any camera model (freecam or arcball cam) you like. The camera must be set up as its own class with the nine lookAt parameters as members. The class definition should be in its own Camera.h file with the implementation in a corresponding Camera.cpp file.

Lastly, connect a pop-up menu to the right mouse button that provides options to the user. At a minimum, it must include three options:
  1. "Display/Hide Control Cage" which toggles if the control points and cage are visible or not. (It is possible to change the text of a menu item, so you don't have to display a confusing option.)
  2. "Display/Hide Bézier Curve" which toggles if the actual curve is visible or not.
  3. A "Quit" option which closes the program. The user may still press ESC as in prior assignments to close the program as well.
You will be using Bézier curves as part of your midterm project, so it's a good idea to write your functions as generally as possible (e.g., have a function that takes 4 controls points and an interpolant as input and returns the corresponding point on the curve, and a similar function for the entire curve). It might be helpful to define your own ControlPoint class which has the necessary (x, y, z) information. Then define a Bézier class that contains four ControlPoints. And so on as needed.
You continue on your way towards the city, as your new friend follows along with you. You haven't felt any different yet, but a magic pet can't be bad for a hero's arsenal can it? After completing your good deed for the day, you hope you've bought yourself some extra good luck. No matter who you may meet in this coming city, you now feel prepared to face off against whatever trouble you may encounter. After trusting the kind man who offered you the transport, you trust your faith that your pet will help you as well.


Part II - Website


Update the webpage that you submitted with A3 to include an entry for this assignment. As usual, include a screenshot (or two) and a brief description of the program, intended to showcase what your program does to people who are not familiar with the assignment.


Documentation


With this and all future assignments, you are expeced to appropriately document your code. This includes writing comments in your source code - remember that your comments should explain what a piece of code is supposed to do and why; don't just re-write what the code says in plain English. Comments serve the dual purpose of explaining your code to someone unfamiliar with it and assisting in debugging. If you know what a piece of code is supposed to be doing, you can figure out where it's going awry more easily.

Proper documentation also means including a README.txt file with your submission. In your submission folder, always include a file called README.txt that lists:
  • Your Name / email
  • Assignment Number / Project Title
  • A brief, high level description of what the program is / does
  • A usage section, explaining how to run the program, which keys perform which actions, etc.
  • Instructions on compiling your code
  • Notes about bugs, implementation details, etc. if necessary
  • How long did this assignment take you?
  • How much did the lab help you for this assignment? 1-10 (1 - did not help at all, 10 - this was exactly the same as the lab)
  • How fun was this assignment? 1-10 (1 - discontinue this assignment, 10 - I wish I had more time to make it even better)


Grading Rubric


Your submission will be graded according to the following rubric.

PercentageRequirement Description
5%Control points are read in from file correctly. (Your program will be tested against two new control point files that we provide)
10%Bézier curve is evaluated correctly.
10%Bézier curve is drawn correctly.
5%Control points of the Bézier curve are drawn correctly.
5%Control cage is drawn correctly.
15%Pet is drawn hierarchically and is animated while moving.
15%Animated pet moves correctly along curve, jumps back to start at the end of the curve, and repeats this process indefinitely.
15%Bézier curve is centered around hero. As the hero moves throughout the world, the curve moves with the hero and continues to revolve around the hero.
5%Camera class defined in separate Camera.h file and implementation provided in accompanying Camera.cpp file.
5%Camera follows arcball cam or freecam model. Left mouse button controls view. If using arcball cam, Ctrl + Left mouse button controls zoom.
5%Pop-up menu attached to right mouse button. Display/Hide Control Cage, Display/Hide Bézier Curve and Quit are listed as options. Other options may be included as well.
5%Submission includes source code, Makefile, and README.txt.
Source code is well documented. Webpage named <heroName>.html submitted and updated with screenshot from latest assignment. Submission compiles and executes in the lab machine environment.


Experience Gained & Available Achievements


Assignment Attribute
Assignments +100 XP
Web Attribute
Web +100 XP
Mobius Strip
Mobius Strip

*NOTE: Since this assignment builds off exactly where Assignment 3 left off, the hidden achievements from Assignment 3 will also apply to this assignment. The Extra Credit Achievement from A3 cannot be earned from this assignment (A4). If you already earned the hidden achievements from A3, you cannot earn them a second time from A4.


Submission


Please update you Makefile so it produces an executable with the name a4. When you are completed with the assignment, zip together your source code, Makefile, README.txt, and www/ folder. Name the zip file, <HeroName>_A4.zip. Upload this file to Blackboard under Assignment4.


This assignment is due by Friday, September 30, 2016 by 11:59pm.
Last Updated: 01/01/70 00:00


Valid HTML 4.01 Strict Valid CSS! Level Triple-A conformance, W3C WAI Web Content Accessibility Guidelines 2.0