Visibility: Assigments


Required

1 - Get the library libvisib.a . Save the file visib.tgz , decompress it with gunzip and use tar to create the directory "./i3d/base/visib" . Compile and install the library.

2 - Write a program to generate a set of triangles. As input use (some of) the following parameters: number of triangles; size; orientation; aspect ratio; distribution with respect to principal directions (x,y,z), and color. The output should be a triangle list in SDL.

3 - Write a program to generate a set of spheres. The input should be similar to (2). The output should be sphere primitives in SDL.

4 - Write a program to read a primitive in SDL and create a a polygonal mesh approximating it. The output should be a triangle list in SDL.

5 - Write a program to compute visibility using z-buffer. The input should be a set of triangle lists. The output should be: (1) an image of the visible triangles; and (2) a image with the z values.

6 - Write a program to compute visibility of primitives using ray casting. The input should be a set of primitives. The output should be: (1) an image of the visible surfaces; and (2) a image with the z values.

7 - Write a program to compute visibility of using the painter's algorithm. The input should be a set of spheres (converted to a polygonal approximation). The output should be: (1) an image of the visible triangles; and (2) a image with the z values.


Optional

8 - Write an interactive program to compute visibility of primitives using ray casting. The user should be able to point at a screen location and the program should output: id, z-value, and normal of the visible surface of the corresponding point on the surface.

9 - Compare the results of (6) and (7) for the same set of spheres. First case: non-intersecting spheres. Second case: intersecting spheres.

10 - Compare the results of (6) and (7) for arbitrary triangles.

11 - Extend (6) to CSG objects.


Challenge

12 - Discuss how to implement the Warnock Visible surface algoritm for (1) spheres (2) triangles.