Chapters 5'7 and 5'8: Projection Matrices - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

Chapters 5'7 and 5'8: Projection Matrices

Description:

Parallel Projections objects are viewed as though the camera were an infinite ... converts the frustum volume to a right parallelepiped, to which we can then ... – PowerPoint PPT presentation

Number of Views:20
Avg rating:3.0/5.0
Slides: 13
Provided by: bry946
Category:

less

Transcript and Presenter's Notes

Title: Chapters 5'7 and 5'8: Projection Matrices


1
Chapters 5.7 and 5.8Projection Matrices
  • Todd Bryan
  • 1 March 2001
  • CS594 Scientific Visualization

2
Two Types of Projections
  • Parallel Projections objects are viewed as
    though the camera were an infinite distance from
    the scene
  • Perspective Projections real-world projections,
    where parallelism is not preserved. All lines
    have a vanishing point.

3
Parallel Projection Matrices
  • We use projection normalization, which converts
    all projections to a standard viewing volume and
    then applies a simple orthogonal projection
    matrix.
  • The canonical view volume is a cube centered on
    the origin with sides

x 1 y 1 z 1
4
Transforming to the canonical volume
  • First, we must translate the volume to the origin
  • Second, we scale the volume to the canonical
    dimensions
  • This is done with the projection matrix

5
Setting up parallel projections in OpenGL
  • glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0)
  • If we want to define a different viewing volume,
    the function call looks like glOrtho(-7.0, 7.0,
    -3.0, 5.0, -2.0, 13.0)
  • If the defined volume is different from the
    canonical viewing volume, OpenGL must map the
    viewing volume back to the canonical box.

6
Transformation Matrices
Scaling Matrix
Transformation Matrix
Result
7
Oblique Projections
Up to this point we have assumed the projectors
the lines from object to the viewing plane are
all orthogonal to the viewing plane. Oblique
projections are allowed in OpenGL. They are
equivalent to a shearing of each object in the
viewing volume. A shearing matrix is
concatenated to the perspective matrix.
8
Envisioning Oblique Projections
  • The direction of projection IS NOT orthogonal to
    the projection plane.

9
Concatenating the Shearing Matrix
  • theta and phi are the projection plane rotation
    angles relative to the x and y axes
  • We concatenate H to ST and then use, again, the
    simple orthogonal projection

10
Perspective Projections
In a perspective projection our viewing volume
becomes a truncated pyramid (a frustum) which
must be distorted to our canonical volume before
we may apply the orthogonal projection.
11
The Perspective Normalization Matrix
This matrix converts the frustum volume to a
right parallelepiped, to which we can then apply
an orthographic projection.
12
Perspective Projections in OpenGL
  • glFrustum(5.0,-5.0,10.0,10.0,3.0,3.0)
  • OpenGL does not restrict us to symmetric
    frustums.
  • The glFrustum() call requires both z parameters
    (near and far) to be positive i.e., the
    projection plane must be in front of the camera.
Write a Comment
User Comments (0)
About PowerShow.com