CS594 Computer Graphics Lab 2
Objectives
- To expand your software with new functions with well
thought out designs and high quality implementation.
- To understand and implement ambient, diffuse and
specular lighting conditions and flat/smooth shading.
- To understand and implement basic polygon texture
mapping techniques.
- To understand and implement
environment mapping.
- To understand and be able to use pixel data
functionality of OpenGL.
- To understand at least one image format, and be able to
read such formatted images.
Assignment Description
The basic steps you will go
through in this lab include:
- Obtain per-vertex normal by computing cross products.
Make sure that all the normals across the triangle mesh are pointing
outwards. (How do you find out and store the neighborhood information?)
- Implement ambient, diffuse and specular components with
glMaterial class function calls. A table of known material properties of a
range of material types, from brass to copper, gold, emerald, jade and
rubber, have been provided under the class directory (~huangj/CS594F08/materials_ogl.htm)
- Implement smooth shading.
- Understand at least one image format, suggested formats
are *.rgb, *.bmp and *.targ. Implement your own routine to load images
from disk into memory for texture mapping purposes. (please look under
class directory: ~huangj/CS594F08/RGBfiles)
- Use a simple cube of unit size. Do a basic
polygon texture map on all 6 faces with any image you would like to use.
(How would you store the texture coordinates?)
- Use a simple sphere, map a global map onto the sphere.
Please try to use both color and opacity channels to create an earth model
with the continents being opaque (alpha = 1.0) and the oceans being
none opaque (alpha < 1.0).
- Understand and implement environment mapping with
OpenGL automatic texture coordinate generation functions.
- Implement cubic environment mapping without using OpenGL
automatic texture coordinate generation function, but instead, try to
generate your texture coordinates.
- Use procedural texture to apply solid texturing of
marble to any model of your choice (better with object in sculpture
flavors) (Where would you store 3D texture coordinates?) The related
source code is located under ~huangj/CS594F08/Marble. You should
first use the given function to compute a 3D texture and load that into
memory (page 372, red book, ed 1.2). And then use 3D texture coordinates
to performance the texture mapping.
Extra credit
Try to
arrange a scene with the models that you have access to. (We will talk about
scene graph in the later half of the semester. But with not too many object, it
is doable without using scene graphs.)
-
Create a
scene where a Buddha or a sculpture is standing in front of a mirror in a room
with texture mapped floor. 30%
- Create a solar system filled with texture mapped earths.(yes, 9 earths around the sun). 10%
-
Anything
else you would like to do. Please run it by me before you do it, so that I have
an idea how much extra credit I would be giving out.
Deadline
Tuesday, October 14, 2008
Detailed Lab Setup Information
Please consult TA's
Suggested Strategy
The assignment description is meant as a brief guidance of what steps you need
to go through. It
is highly desirable for you to have a big picture and seriously spend a couple
hours designing your software, and think about the trade off that you would
face, BEFORE you actually go implement
anything. You should not only consider performance, readability,
maintainability but also possibilities for further development of new functions
as key issues in your design.
This would end up saving you a lot of time later on, because of less number of
patches you have in your code and a much more efficient debugging process in
result.
During your implementation, an
incremental way of development is always helpful with debugging too. As usual,
it is strongly suggested that you start early on this lab. There are a lot of
stuff involved in this lab.
Happy rendering!