Docsity

OpenGL Assignment: 'Fiveshapes' Program with Interactive Selection and Rotation - Prof. Jo, Assignments of Computer Graphics

Toggle sidebar
bg1
CMSI 371
CO M P U T E R GR A P H I C S
Spring 2007
Assignment 0125
With your repositories set up, it’s time to get your hands dirty (and your feet wet!) with OpenGL.
Not for Submission
1. Get OpenGL and C/C++ installed and work-
ing on whatever system you plan to use. Type
in any or all of the sample code given out in
class just to get the hang of entering code,
building it, then running it.
2. Visit Nate Robins’s OpenGL tutorial site
(linked from the course Web site) and down-
load his tutorial source code. Build it and run
it, as another exercise toward building OpenGL
programs and getting some good hands-on
training on the API.
Don’t cheat by downloading the pre-built ver-
sions — make yourself build it from source.
For Submission
What to Do
Write a “spinning shape” program similar to the
spinningsquare and icosahedron samples, with the fol-
lowing differences:
•Use glutKeyboardFunc() to allow the user to choose
among five (5) different shapes by typing keys
“1” to “5.”
•Use glutSpecialFunc() to allow the user to modify
the rotation rate by hitting the left and right ar-
row keys.
•Maintain the ability to start/stop spinning the
displayed shape with a mouse click.
Be creative with your shape choices; use this as-
signment to explore the different drawing possibili-
ties facilitated by the OpenGL API.
How to Turn it In
1. Commit your program to CVS, under
/homework/cmsi371/fiveshapes.
2. Tag the submission as hw-0125.
Extra Credit
You will get extra credit if your fiveshapes program
includes both of these enhancements:
•Genuine 3D shapes that do not use the GLUT
convenience functions.
•Lighting and shading — these do not need to be
interactive; just “turn the lights on.”

Partial preview of the text

Download OpenGL Assignment: 'Fiveshapes' Program with Interactive Selection and Rotation - Prof. Jo and more Assignments Computer Graphics in PDF only on Docsity!

CMSI 371

C O M P U T E R G R A P H I C S

Spring 2007

Assignment 0125

With your repositories set up, it’s time to get your hands dirty (and your feet wet!) with OpenGL.

Not for Submission

  1. Get OpenGL and C/C++ installed and work- ing on whatever system you plan to use. Type in any or all of the sample code given out in class just to get the hang of entering code, building it, then running it.
  2. Visit Nate Robins’s OpenGL tutorial site (linked from the course Web site) and down- load his tutorial source code. Build it and run it, as another exercise toward building OpenGL programs and getting some good hands-on training on the API. Don’t cheat by downloading the pre-built ver- sions — make yourself build it from source.

For Submission

What to Do

Write a “spinning shape” program similar to the spinningsquare and icosahedron samples, with the fol- lowing differences:

  • Use^ glutKeyboardFunc()^ to allow the user to choose among five (5) different shapes by typing keys “1” to “5.”
  • Use^ glutSpecialFunc()^ to allow the user to modify the rotation rate by hitting the left and right ar- row keys.
  • Maintain the ability to start/stop spinning the displayed shape with a mouse click. Be creative with your shape choices; use this as- signment to explore the different drawing possibili- ties facilitated by the OpenGL API.

How to Turn it In

  1. Commit your program to CVS, under /homework/cmsi371/fiveshapes.
  2. Tag the submission as hw-.

Extra Credit

You will get extra credit if your fiveshapes program includes both of these enhancements:

  • Genuine 3D shapes^ that do not use^ the GLUT convenience functions.
  • Lighting and shading — these do not need to be interactive; just “turn the lights on.”