CSC 461: Computer Graphics I (Fall 2006)
Programming Project 2
Due
Moving and rotating a color cube.
Description:
In this project you will practice the interactive graphics programming and animating pictures by using different callbacks.
The only object that is presented on the screen window is a color cube from Project 1. However, this time, the color cube should be self rotating and horizontal or vertical moving.
Your task:
Write an OpenGL program to perform the following tasks. Please comment your program as clear as possible.
· (30 points) Initially, the color cube rotates and moves in either of following fashions:
o Rotating count-clockwise around the Y-axis and moving from the left edge of the window to the right along the middle line of the window height. The rotation and moving speed should be constant. When the cube disappears at the right edge of the window, it goes back to the left side and continues the rotation and moving along the same horizontal line.
o Rotating around the X-axis (count-clockwise) and vertically moving from the top to the bottom of the window along the middle line of the window width. The rotation and moving speed should be constant. Once disappearing in the bottom, the cube will present on the top of the window at the same vertical line and continue the rotation and vertical moving.
· (10 points) When you click the left mouse button on the cube, the cube stops rotation and moving, if the cube is on rotation and moving; or the cube restores rotation and moving, if it stops.
· (15 points) When you hold the left-click on the cube and move the cursor, the cube should also move as the cursor moves. When you release the left button, the cube restores its rotation and moving.
· (5 points) When you right-click the mouse button, a menu should be popped up. Menu entries should include: Moving Direction, Zoom, Exit.
o (5 points) When Moving Direction is chosen, a sub menu is popped up, which contains two entries: Horizontal and Vertical.
§ (5 points) When Horizontal is chosen, the cube should be rotating around the Y-axis and moving from left to right.
§ (5 points) However, if Vertical is chosen, the cube will rotate around the X-axis (count-clockwise) and vertically move from the current position to the bottom of the window.
o (5 points) When Zoom is clicked, a sub menu is popped up with two menu items for zoom-in and zoom-out the color cube.
§ (5 points) When zoom-in item is selected, the cube is enlarged 25%.
§ (5 points) When zoom-out item is selected, the cube is shrunken by 25%.
o (5 points) When Exit is chosen, the program terminates.
· (5 points) When you type Ctrl-S, the cube stops motion. When you type Ctrl-C, the cube continues its current rotation and moving.
· Extra credit (10 points): Add more entries to the menu or sub menu to allow the user to change the rotation speed, moving speed, rotation direction (clockwise or count-clockwise), and/or moving direction (left-right or right-left, top-down or bottom-up).
Submission:
o Submit your program code by email to jhan@csudh.edu. Submitting a hardcopy of the source code is unacceptable.
o You should also turn in a design document (either softcopy or hardcopy)