main-p3-written-lighting-texturing

Project 3 Written Assignment 1 - Lighting, Texturing and Projection

due Monday, November 19th at 11:59pm

Please place a file with your written answers into the P3-Written subdirectory of your handin directory. Please name the file something like “lighting” or “written1” (there will be another written assignment that must go into this directory)

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).

(yes, you can use this as a hack to fake reflections, much like we use projection to create hack shadows. there’s a slight catch in that you need to get the drawing order correct so occlusions work - but don’t worry about it for this question.)

Advanced Texturing

OK, this is just to make sure that you’ve done the required readings in the Real-Time Rendering Book (the Texture Readings.

  • What is a synonym for “repeat” with texture coordinates? (section 5.1)
  • When would “border” for a texture be useful?
  • Why is a ripmap better than a mipmap?
  • What shape did Blinn and Newell’s original environment mapping use for the environment map?
  • What page does the cubic environment mapping section begin on? (this will tell us which of the 2 versions of the readings you did)
Page last modified on November 12, 2007, at 12:42 PM