Docsity

Perspective Projections - Computer Graphics - Lecture Slides, Slides of Computer Graphics

Partial preview of the text

Download Perspective Projections - Computer Graphics - Lecture Slides and more Slides Computer Graphics in PDF only on Docsity!

Perspective Projections

Perspective Projections

  • Remember the whole point of perspective projections

Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004) Docsity.com

Projection Calculations (cont…)

  • Any point along the projector (x’, y’, z’) can be given as:
  • When u = 0 we are at P, while when u = 1 we are at the Projection Reference Point

z z z z u

y y y y u

x x x x u

prp

prp

prp

0 ≤ u ≤ 1

Projection Calculations (cont…)

  • At the view plane z’ = zvp so we can solve the

z’ equation for u:

z z

z z

u

prp

vp

Perspective Projection Transformation Matrix

  • Because the x and y coordinates of a projected point are expressed in terms of z we need to do a little work to generate a perspective transformation matrix
  • First we use a homogeneous representation to give xvp and yvp as:
  • where:

h

x x (^) vp = h h

y y (^) vp = h

h = zprp − z Docsity.com

Perspective Projection Transformation Matrix (cont…)

  • From the previous equations for xvp and yvp we can see that:

y y(^ z z )^ y (z^ z)

x x z z x z z

h prp vp prp vp

h prp vp prp vp = − + −

= − + −

Perspective Projection Transformation Matrix (cont…)

  • Setting up the matrix so that we calculate xh

and yh is straightforward

  • However, we also need to preserve the z values
    • depth information
  • Otherwise the z coordinates are distorted by

the homogeneous parameter h

  • We don’t need to worry about the details here,

but it means extra parameters (sz and t (^) z) are added to the matrix

Perspective Projection Transformation Matrix (cont…)

  • The following is the perspective projection matrix which arises:

−

− −

− −

=

prp

z z

prp vp prp prp prp

prp vp prp prp prp

pers

z

s t

z z y y z

z z x x z

M

0 0 1

0 0

0

0

Setting Up A Perspective Projection (cont…)

  • The field of view angle can be a more intuitive way to specify perspective projections
  • This is analogous to choosing a lense for a camera

Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)^ Field of view Docsity.com

Setting Up A Perspective Projection (cont…)

  • Increasing the field of view angle increases the height of the view plane and so increases foreshortening

Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004) Docsity.com

Setting Up A Perspective Projection (cont…)

  • We need one more thing to specify a perspective projections using the filed of view angle
  • The aspect ratio gives the ratio between the width sand height of the view plane

Summary

  • In today’s class we looked at the detail of generating a perspective projection of a three dimensional scene