Homework
  • Compile the projection program in the HOMEWORK_2 directory and see what effect the parameters have.

  •  

     


     

  •  Knowing what you know about gluLookat() modify your program from the previous session to have the viewpoint "orbit" above the function surface.
  •  Extra Credit:  Follow above the function surface along a pre-defined path (as if the viewpoint were an aircraft)

  •  

     
     
     


 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

  Orthographic Projection

void glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far); 

Creates a matrix for an orthographic parallel viewing volume and multiplies the current matrix by it. (left, bottom, -near) and (right, top, -near) are points on the near clipping plane that are mapped to the lower-left and upper-right corners of the viewport window, respectively. ( left, bottom, -far) and (right, top, -far) are points on the far clipping plane that are mapped to the same respective corners of the viewport. Both near and far can be positive or negative.

     
     
     

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

  Viewport Transformation
  • The windowing system is responsible for opening the window on the screen
  •  The viewport transformation is responisble for mappiing the image onto the the window area

  • void glViewport(GLint x, GLint y, GLsizei width, GLsizei height); 

    Defines a pixel rectangle in the window into which the final image is mapped. The (x, y) parameter specifies the lower-left corner of the viewport, and width and height are the size of the viewport rectangle. By default, the initial viewport values are (0, 0, winWidth, winHeight), where winWidth and winHeight are the size of the window.
     

  •  The aspect ratio of the window and viewport should map to the viewing volume to avoid distortion


  •  
     
     

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

  Manipulating the matrix stacks
  • Fin 4
  •  

  •  

     

  •  

  •  

     
     
     


 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

  End of Presentation
  • Fin 5
  •  

  •  

     

  •  

  •  

     
     
     


 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

  End of Presentation
  • Fin 6
  •  

  •  

     

  •  

  •  

     
     
     


 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

  End of Presentation
  • Fin 7
  •  

  •  

     

  •  

  •  

     
     
     


 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

  End of Presentation
  • Fin 8
  •  

  •  

     

  •  

  •  

     
     
     


 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

  End of Presentation
  • Fin 9
  •  

  •  

     

  •  

  •  

     
     
     


 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

  End of Presentation
  • Fin 10
  •  

  •  

     

  •  

  •