600.357/600.457 Assignment 3

Handed out: Nov 21
Due: Dec 10, 11:59pm.

457 students, turn in your assignment here
357 students, turn in your assignment here

As usual, a Makefile/project file, documented source and a README file must be included.

Note: 20% of your grade will be depend on the design, readability and documentation of your program.


We have finished implementation of the bulk of OpenGL pipeline. This included transformation, clipping, lighting, rasterization, shading and anti-aliasing. Rasterization can be modified to incorporate a rich class of per-pixel color computation using textures. In this assignment we will understand the concept of texture coordinates (and rely on a standard OpenGL implementation to actually do the mapping). In this assignment you will generate textures to perform environment mapping by taking digital photos in six directions at any point on the campus. A good format to use is an uncompressed raw-RGB-per-pixel format: the ppm (portable pixel map) format. (Here is an example ppm reader and an example ppm file.) Many programs convert from standard camera jpg formats to ppm. Find one (e.g., xnview).

off is a simple format. It starts with a comment saying it is an "OFF" file. It then lists the number of vertices, polygons and edges in a model. It then lists each vertex followed a list of polygons. The first number, n, for a polygon is the number of vertices it has and the other (n-1) numbers are indices (corresponding to the vertex array) of its vertices. Here is an example file and an example reader code fragment. You may adapt the viewer you implemented in your assignment 1 to control the view-point or implement a new one. Be sure to use a highly shiny surface material.

Fun extension for extra credit

457 students will also use projective texture mapping to project a movie onto the face of a cube. You will generate the texture coordinates every frame. The cube should be allowed to be moved on screen using mouse manipulation. If you can't read a movies, you may map a single image in all frames. You should allow the camera of model viewing as well as the (camera of) projector to be manipulated by swithing the manipulation mode to "camera" or "projector" by choosing from a menu titled "manip_mode".

Hints

Some graphics cards support automatic environment map texture coordinate generation in OpenGL. Your coordinates will not exactly match OpenGL's but you could use that as a reference nonetheless.

Don't ask what extra implementation is required of the 457 students.

You may use these Six images for six faces of the cube for Assignment 4.


subodh@cs.jhu.edu

-- The URL of this page is: http://www.cs.jhu.edu/~subodh/457/asn4.html --