Page 171 - Computer Graphics Handout
P. 171

mat4 Perspective(Glfloat fovy, Glfloat aspect, Glfloat near, Glfloat far);





















          allows us to specify the angle of view in the up (y) direction, as well as the aspect ratio—width divided by height—of the projection
          plane. The near and far planes are specified as in Frustum.



          4.7 PERSPECTIVE-PROJECTION MATRICES


          For perspective projections, we follow a path similar to the one that we used for parallel projections: We find a transformation that
          allows us, by distorting the vertices of our objects, to do a simple canonical projection to obtain the desired image.
          Our first step is to decide what this canonical viewing volume should be. We then introduce a new transformation, the perspective-
          normalization  transformation,  that  converts  a  perspective  projection  to  an  orthogonal  projection.  Finally,  we  derive  the
          perspective-projection matrix we will use in OpenGL.

          4.7.1 Perspective Normalization
          In Section 4.5, we introduced a simple perspective-projection matrix. For the projection  plane at  z =−1 and the center of the
          projection at the origin, the projection matrix is









          To form an image, we also need to specify a clipping volume. Suppose that we fix the angle of view at 90 degrees by making the
          sides of the viewing volume intersect the projection plane at a 45-degree angle. Equivalently, the view volume is the semi-infinite
          view pyramid formed by the planes

















                                                             171
   166   167   168   169   170   171   172   173   174   175   176