1 / 27

CS 445 / 645 Introduction to Computer Graphics

CS 445 / 645 Introduction to Computer Graphics. Lecture 10 Camera Models. Where are we?. Rendering Pipeline. Modeling Transformation. Display. Illumination. Rasterization. Viewing Transformation. Projection. Clipping. Pinhole Camera. Ingredients Box Film Hole Punch Results

caia
Download Presentation

CS 445 / 645 Introduction to Computer Graphics

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. CS 445 / 645Introduction to Computer Graphics Lecture 10 Camera Models

  2. Where are we? • Rendering Pipeline ModelingTransformation Display Illumination Rasterization ViewingTransformation Projection Clipping

  3. Pinhole Camera • Ingredients • Box • Film • Hole Punch • Results • Pictures! www.kodak.com www.debevec.org www.pinhole.org

  4. Pinhole Camera • Non-zero sized hole Multiple rays of projection Pinhole Film Plane

  5. Pinhole Camera • Theoretical Pinhole One ray of projection Pinhole Film Plane

  6. Pinhole Camera • Field of View Pinhole Field of View FocalLength Film Plane

  7. Pinhole Camera • Field of View Pinhole FocalLength Field of View Film Plane

  8. Moving the Film Plane • Varying distance to film plane • What does this do? Pinhole d1 Field of View d2 Film Plane

  9. Adding a Lens • Pinhole camera has small aperture (lens opening) • It’s hard to get enough light to expose the film • Lens permits larger apertures • Lens permits changing distance to film plane without actually moving the film plane

  10. Computer Graphic Camera • We use • Center of Projection (COP) • Projection Plane COP Projection Plane

  11. Moving the COP • Perspective vs. Orthographic Views Perspective When COP at infinity, Orthographic View

  12. Multi-point Perspective • One-point Perpective • One Vanishing Point • Two-point Perspective • Two Vanishing Points http://www.sanford-artedventures.com/create/tech_2pt_perspective.html

  13. Perspective Projection • Our camera must model perspective

  14. How tall shouldthis bunny be? Perspective Projection ProjectionPlane COP

  15. Perspective Projection • The geometry of the situation is that of similar triangles. View from above: • What is x’ ? Viewplane X P (x, y, z) x’ = ? (0,0,0) Z d

  16. Perspective Projection • Desired result for a point [x, y, z, 1]T projected onto the view plane: • What could a matrix look like to do this?

  17. A Perspective Projection Matrix • Answer:

  18. A Perspective Projection Matrix • Example: • Or, in 3-D coordinates:

  19. Homogeneous Coordinates • The role of w in (x, y, z, w) • All 3-D points are described with a four vector • All 3-D tranformations are represented with 4x4 matrix • When projected to screen coordinates (rasterization) • x, y, and z are divided by point’s w value • This allows us to perform perspective foreshortening while preserving the reversibility of the mapping • We can retrieve x, y, and z by multiplying by w

  20. Perspective Projection • Perspective projection matrix is not affine • Parallel lines not preserved • Perspective projection is irreversible • Many 3-D points can be mapped to same (x, y, d) on the projection plane • No way to retrieve the unique z values

  21. Orthographic Camera Projection • Camera’s back plane parallel to lens • Infinite focal length • No perspective convergence

  22. Pipeline Modelview Projection PerspectiveDivision Clip Rasterize

  23. OpenGL Pipeline • Projection matrix is stored in GL_PROJECTION stack • This controls ‘type’ of camera • All vertices are multiplied by this matrix • GL_MODELVIEW controls camera location • All vertices are multiplied by this matrix

  24. Making GL_PROJECTION • glFrustum – for perspective projections • xmin • xmax • ymin • ymax • near • far • Camera looks along –z • min/max need not be symmetric about any axis • near and far planes are parallel to plane z=0

  25. Making GL_PROJECTION • gluPerspective – for perspective projections • fovy • aspect • near • far • fovy is the angle between top and bottom of viewing volume • aspect is ratio of width over height • This volume is symmetrical • View plane is parallel to camera

  26. Making GL_PROJECTION • glOrtho – for orthographic projections • left • right • bottom • top • near • far • (left, bottom) and (right, top) define dimensions of projection plane • near and far used to clip

  27. Making GL_PROJECTION • It’s like any other matrix • These OpenGL commands just build a matrix for you • You could build the matrix yourself • You can multiply the GL_PROJECTION matrix by any affine transformation you wish • Not typically needed

More Related