Projects / Project 3

Project 3 Written Assignment 1 - Lighting, Texturing and Projection

due Thursday, April 15th at 2.30pm.

 

1. Lighting

A single polygon at the origin is viewed from above (0,10,0). A single point light source is placed at (10,10,0). The light has intensity 1, and the polygon has diffuse and specular reflectance of 1. The specular exponent is 5.

 

For the 3 points on the polygon (0,0,0) (5,0,0) (10,0,0), compute the amount of specular and diffuse lighting.

 

2. Texture Map Coordinates

Consider a square pyramid (the base of the pyramid is a square) as shown in the picture. Texture coordinates are given for each point.

 

2A: Sketch what this pyramid would look like if the 2x2 checkerboard (texture 1) is applied.

2B: Suppose that you want to texture the pyramid with 4 horizontal stipes, but the only texture you had was the 4x4 checkerboard (Texture2). Give textue coordinates for the 5 vertices that would produce this. (note: every vertex only gets one texture coordinate).

 

2C: If mip-mapping is used, there are reasons why using the checkerboard texture might not be as good as using the more "obvious" texture (Texture3). Explain this.

 

3. Getting triangles to hardware

Tesselate the 3 squares (8 vertices) below. Make sure that your triangles are consistent. Also, choose the tesselation so that the fewest number of vertices can be drawn (using a triangle strip or fan). Your answer should give both the 6 triangles as well as how they would be drawn using OpenGL.

 
 

4. Projection Matrices

The reflection in a planar mirror can be created by placing the eye point on the other side of the mirror. If you draw the picture from the "virtual eyepoint" as if the mirror were a window, then you would create the image that you would see looking at the mirror from the real eyepoint.

Suppose that the viewer is at 0,5,5, and that the XY plane (Z=0) is a mirror. Write the 4x4 projection matrix that would project points from their world space positions to where they would appear in the mirror. Make your projection place things totally on the wall (Z=0).