CSE 167 - Introduction to
Computer Graphics - Fall 2004
Instructor: Sam Buss,
Univ. of California, San Diego
Project #3 - Build a 3D wire-frame scene with a surface of rotation and some other geometry.
Due Date: Tuesday, October 26, midnight.
New: Advice on controlling your loops for the surface of revolution.
Goals: Learn how to create a parametric surface (namely, a portion of an surface of rotation) using quad strips and triangle fans or strips. Learn how to model simple scenes with the supplied GLUT shapes such as spheres, cones, etc. Find out culling of back faces works. Find out how to toggle wireframe mode. Discover that wireframe objects, especially when combined with animation can look very three dimensional. Discover, however, that flat, solidly colored objects look much too flat and non-three-dimensional.
What to hand in:
(1) Make a directory called
WireFrameScene in your CSE 167 home directory. (The CSE 167
storage directory on ieng9, under Class Resources, not your "My
Documents" folder). The file modification dates will serve as a time stamp
so we will know files have been turned in on time. Place, in that
directory, all your source files and project files (including .vcproj and
.sln files). Also place there a screenshot of your scene.
(2) You must upload also, a thumbnail GIF file, a
full size screenshot and a very simple HTML file using a web page described
below. This will collect the entire class's projects into a web page that
will be made accessible on the web.
As usual, grading
will be personalized and one-on-one with a TA or with Sam Buss. Your
program must run on the PC lab, you must come into the PC lab and meet one of
us. You will have to show your source code, run the program, possibly make
changes on the spot to your program and recompile as requested by the grader,
and be able to explain how your program works and why it renders what it does.
Your files should be complete and project must recompile in the ieng9
directory. You will then come see a TA to get your work
graded. This grading MUST be done within one week of the due date.
FOR THIS PROJECT #3, DO THE FOLLOWING STEPS #1 - #7.
1. Download the file WireFrameScene.zip
from the web. This zip file contains four files: (1&2) C++ source
files WireFrameScene.cpp and WireFrameScene.h, (3)
an executable WireFrameSceneDemo.exe, and (4)
a template index.html file for later turning-in.
Run the
executable file on a PC. You will see a scene with a surface of rotation
and a letter "S". (That's my initial.). Note the following commands
act on the scene:
Your job is to re-create this program -- sort of!!. You will re-create the surface of revolution exactly, and form something creative based on your own first initial instead of the "S". You will also supply some animation.
2. Form a new project and workspace. Include the two source files in it. The supplied source code handles all the keystroke commands, and draws the flat base plane, and a sphere that marks the position of the surface of rotation. It has empty routines that will be used to form the surface of rotation and the geometry based on your initials. For information on how to build a new project, read this handout on starting a new Visual Studio.NET C++ project.
3. Rewrite the code that generates the surface of rotation. The
surface is a surface of rotation from from the cosine(x) curve for
0 ≤ x ≤ π,
that is, x in [0,π]. You
should scale and position the surface of rotation so that it looks approximately
like the one in the supplied executable.
You should use quad strips and/or
triangle strips and/or triangle fans to build the surface of rotation.
4. Design some geometric shapes that are based (*loosely* based is OK) on
the first initial of your first name. Do something creative so no two of
you have the same geometry. Suggestions: use the glutSolid objects,
such as spheres, cones, dodecahedra, tori, etc. to build your
objects. The course
web page has pointers to GLUT documentation that describes how to call these
routines. The glutSolid... objects will be automatically rendered in
wireframe mode when wireframe mode is activated. You may also use quad
strips, triangle fans, etc. if you wish. The geometric shapes should be
solid (i.e., they should not consist of points and lines).
If you wish to use cylinders: GLUT does not supply a cylinder
drawing routine, but you can find a substitute on the
textbook's web page under
OpenGL software.
6. Animate some portion of your geometry. In the supplied code, note that the top piece of the "S" is animated half the time and stationary half the time. You will need to call glutPostRedisplay() at the right time in order to make the animation run. (You can see where this is done in the Solar program. You should understand what this call is achieving.)
5. Leave the base plane the same as it is in the supplied code. Your finished program should look the same as the supplied executable, except the "S" is replaced by your own creation and with animation of your own design.
7 Make a screen shot and a thumbnail gif, then turn everything in. Here is a page with detailed turn-in instructions.
Grading is on a scale of 1-10.