1 / 32

Computer Graphics

Computer Graphics. Zhen Jiang West Chester University. Topics. Projection Visibility. Projection. Multiple rays of projection. Pinhole. Film Plane. Projection. One ray of projection. Pinhole. Film Plane. Projection. Field of View. Pinhole. Field of View. Focal Length.

andren
Télécharger la présentation

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. Computer Graphics Zhen Jiang West Chester University

  2. Topics • Projection • Visibility

  3. Projection Multiple rays of projection Pinhole Film Plane

  4. Projection One ray of projection Pinhole Film Plane

  5. Projection • Field of View Pinhole Field of View FocalLength Film Plane

  6. Projection Pinhole FocalLength Field of View Film Plane

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

  8. Projection • We use • Center of Projection (COP) • Projection Plane COP Projection Plane

  9. Projection • Perspective vs. Orthographic Views Perspective When COP at infinity, Orthographic View

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

  11. Projection • Our camera must model perspective

  12. How tall shouldthis bunny be? Projection ProjectionPlane COP

  13. Projection Viewplane X P (x, y, z) (0,0,0) x’ = ? Z d

  14. 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?

  15. Projection

  16. Projection • Example: • Or, in 3-D coordinates:

  17. Projection • Orthographic Camera Projection

  18. 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

  19. 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

  20. 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

  21. Visibility • Why might a polygon be invisible? • Polygon outside the field of view • Polygon is backfacing • Polygon is occludedby object(s) nearer the viewpoint • For efficiency reasons, we want to avoid spending work on polygons outside field of view or backfacing • For efficiency and correctness reasons, we need to know when polygons are occluded

  22. Visibility • Remove polygons entirely outside frustum • Note that this includes polygons “behind” eye (actually behind near plane) • Pass through polygons entirely inside frustum • Modify remaining polygonsto include only portions intersecting view frustum

  23. Visibility • Most objects in scene are typically “solid” • More rigorously: compact, orientable manifolds • Must not cut through itself • Must have two distinct sides • A sphere is orientable since it has two sides, 'inside' and 'outside'. • A Mobius strip or a Klein bottle is not orientable • Cannot “walk” from one side to the other • A sphere is a closed manifold whereas a plane is not

  24. Visibility • For most interesting scenes, some polygons will overlap: • To show the correct image, we need to determine which polygons occlude which

  25. Visibility • Simple approach: display the polygons from back to front, “painting over” previous polygons: • Draw blue, then green, then orange • Will this work in the general case?

  26. Visibility • Intersecting polygons present a problem • Even non-intersecting polygons can form a cycle with no valid visibility order:

  27. Visibility • Early visibility algorithms computed the set of visible polygon fragments directly, then showed the fragments to a display:

  28. Visibility • So, for about a decade (late 60s to late 70s) there was intense interest in finding efficient algorithms for hidden surface removal • Examples: • Binary Space-Partition (BSP) Trees http://symbolcraft.com/graphics/bsp • The Z-buffer Algorithm

  29. Visibility • We know how to rasterize polygons into an image discretized into pixels:

  30. Visibility • What happens if multiple primitives occupy the same pixel on the screen? Which is allowed to paint the pixel?

  31. Visibility • Simple!!! • Easy to implement in hardware • Polygons can be processed in arbitrary order • Easily handles polygon interpenetration

  32. Visibility • Lots of memory (e.g. 1280x1024x32 bits) • With 16 bits cannot discern millimeter differences in objects at 1 km distance • Read-Modify-Write in inner loop requires fast memory • Hard to do analysisi • We don’t know which polygon to map pixel back to • Shared edges are handled inconsistently • Ordering dependent • Hard to simulate translucent polygons • We throw away color of polygons behind closest one

More Related