1 / 29

GR2 Advanced Computer Graphics AGR

GR2 Advanced Computer Graphics AGR. Lecture 3 Viewing - Projections. Viewing. Graphics display devices are 2D rectangular screens Hence we need to understand how to transform our 3D world to a 2D surface This involves: selecting the observer position (or camera position)

jerica
Download Presentation

GR2 Advanced Computer Graphics AGR

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. GR2Advanced Computer GraphicsAGR Lecture 3 Viewing - Projections

  2. Viewing • Graphics display devices are 2D rectangular screens • Hence we need to understand how to transform our 3D world to a 2D surface • This involves: • selecting the observer position (or camera position) • selecting the view plane (or camera film plane) • selecting the type of projection

  3. Perspective Projections • There are two types of projection: perspective and parallel • In a perspective projection, object positions are projected onto the view plane along lines which converge at the observer P1 P1’ camera P2 P2’ view plane

  4. Parallel Projection • In a parallel projection, the observer position is at an infinite distance, so the projection lines are parallel P1 P2 view plane

  5. Perspective and Parallel Projection • Parallel projection preserves the relative proportions of objects, but does not give a realistic view • Perspective projection gives realistic views, but does not preserve proportions • Projections of distant objects are smaller than projections of objects of the same size which are closer to the view plane

  6. Perspective and Parallel Projection parallel perspective

  7. Puzzle

  8. Another Example

  9. yV xV zV Viewing Coordinate System • Viewing is easier if we work in a viewing co-ordinate system, where the observer or camera position is on the z-axis, looking along the negative z-direction Camera is positioned at: (0 , 0, zC)

  10. yv xv zv View Plane • We assume the view plane is perpendicular to the viewing direction The view plane is positioned at: (0, 0, zVP) Let d = zC - zVP be the distance between the camera and the plane

  11. yv Q xv yV camera zv zV view plane Perspective Projection Calculation zQ zVP zC looking along x-axis

  12. Q yV camera zV view plane Perspective Projection Calculation P zQ zVP zC By similar triangles, yP / yQ = (zC - zVP) / (zC - zQ) and so yP = yQ * (zC - zVP) / (zC - zQ) or yP = yQ * d / (zC - zQ) xP likewise

  13. Using Matrices and Homogeneous Coordinates • We can express the perspective transformation in matrix form • Point Q in homogeneous coordinates is (xQ, yQ, zQ, 1) • We shall generate a point H in homogeneous coordinates (xH, yH, zH, wH), where wH is not 1 • But the point (xH/wH, yH/wH, zH/wH, 1) is the same as H in homogeneous space • This gives us the point P in 3D space, ie xP = xH/wH, sim’ly for yP

  14. Transformation Matrix for Perspective xQ yQ zQ 1 xH yH zH wH = 1 0 0 0 0 1 0 0 0 0 -zVP/d zVPzC/d 0 0 -1/d zC/d Then xP = xH / wH ie xP = xH / ( (zC - zQ) / d ) ie xP = xQ / ( (zC - zQ) / d ) yP likewise

  15. Exercises • There are two special cases which you can now derive: • camera at the origin (zC = 0) • view plane at the origin (zVP = 0) • Follow through the operations just described for these two cases, and write down the transformation matrices

  16. Note for Later • The original z co-ordinate of points is retained • we need relative depth in the scene in order to sort out which faces are visible to the camera

  17. Vanishing Points • When a 3D object is projected onto a view plane using perspective, parallel lines in object NOT parallel to the view plane converge to a vanishing point vanishing point one-point perspective projection of cube view plane

  18. One- and Two-Point Perspective Drawing

  19. One-point Perspective This is: Trinity with the Virgin, St John and Donors, by Mastaccio in 1427 Said to be the first painting in perspective

  20. Two-point Perspective Edward Hopper Lighthouse at Two Lights -see www.postershop.com

  21. Orthographic parallel projection has view plane perpendicular to direction of projection Oblique parallel projection has view plane at an oblique angle to direction of projection Parallel Projection - Two types P1 P1 P2 P2 view plane view plane We shall only consider orthographic projection

  22. yv Q xv yV zv zV view plane Parallel Projection Calculation zQ zVP looking along x-axis

  23. Q yV zV view plane Parallel Projection Calculation P yP = yQ and similarly xP = xQ

  24. Parallel Projection Calculation • So this is much easier than perspective! • xP = xQ • yP = yQ • zP = zVP • The transformation matrix is simply 1 0 0 0 0 1 0 0 0 0 zVP/zQ 0 0 0 0 1

  25. yv xv zv View Volumes - View Window • Type of lens in a camera is one factor which determines how much of the view is captured • wide angle lens captures more than regular lens • Analogy in computer graphics is the view window, a rectangle in the view plane view window

  26. View Volume - Front and Back Planes • We will also typically want to limit the view in the zV direction • We define two planes, each parallel to the view plane, to achieve this • front plane (or near plane) • back plane (or far plane) zV back plane front plane

  27. View Frustum - Perspective Projection back plane view frustum view window camera front plane zV

  28. View Volume - Parallel Projection back plane view volume view window front plane zV

  29. View Volume • The front and back planes act as important clipping planes • Can be used to select part of a scene we want to view • Front plane important in perspective to remove near objects which will swamp picture

More Related