MV 3202: Computer Graphics, homework 7

This homework is due Thursday, 9/8/2005, 11:59pm.
  1. What is the texture matrix stack? What does it manipulate? Name one or more uses of this.
  2. How can a texture be used to create diffuse lighting?
  3. How can a texture be used for specular highlites?
  4. Name three or more differences between drawing a bitmap and rendering a textured polygon.
  5. The function drawDisk renders a solid blue disk of radius r. The function drawSquare renders a solid red square with sides of length 2*r such that it tightly encloses the disk. What does the following code render? What is in the stencil buffer after the code has executed?
    glClearStencil(0);
    glClear(GL_STENCIL_BUFFER_BIT);
    glEnable(GL_STENCIL_TEST);
    glDisable(GL_DEPTH_TEST);
    
    glStencilFunc(GL_ALWAYS, 0, 255);
    glStencilOp(GL_KEEP, GL_KEEP, GL_INCR);
    drawDisk();
    
    glStencilFunc(GL_GEQUAL, 0, 255);
    glStencilOp(GL_INCR, GL_DECR, GL_INCR);
    drawSquare();
        
  6. Read Appendix A in your redbook. List, in order, the most important Geometric Operations and the most important Fragment Operations (skip the Pixel Operations) that are performed. I counted 25 total, give or take a few. Just list them, don't explain what those operations are.
Please don't forget to send me a short paragraph that describes your class project in "sales talk," including a picture (screenshot) of your project.