1 / 48

Computer Graphics

Learn about the complexities of projecting 3D objects onto 2D display devices in computer graphics. Explore different types of projections, including perspective and parallel projections.

Download Presentation

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 Projections

  2. 3D Viewing • Inherently more complex than 2D case. • Most display devices are only 2D • Need to use a projection to transform 3D object or scene to 2D display device.

  3. Jetty at Margate England, 1898. http://brightbytes.com/cosite/collection2.html (Jack and Beverly Wilgus)

  4. Graphics Cameras • real pinhole camera: image inverted eye point image plane • computer graphics camera: convenient equivalent eye point center of projection image plane

  5. Transformations Screen coordinates Local coordinates Projection matrix World to camera matrix Local to world matrix 07/11/2019

  6. Projection: Mapping 3-D to 2-D • Scene models are in 3-D space and (but) images are 2-D • so need some way of projecting 3-D to 2-D • Recall, “fundamental challenge” • Planar Projection • Basic approach: • Define a plane in 3-D space • image plane (or film plane) • Project scene onto plane • Map to window viewport • Need to address two basic issues: • how to define plane • how to define mapping onto plane

  7. Projections • Transforms points in a coordinate system of dimension n into points in one of less than n (ie 3D to 2D) • Projectors emanate from a centre of projection, pass through every point in the object and intersect a projection surface to form the 2D projection.

  8. Projection: Essential Definitions(quick look) • Projectors • View plane (or film plane) • Direction of projection • Center of projection • Eye, viewer projection reference point

  9. Planar Geometric Projections • Standard projections project onto a plane (the view plane) – as we’ve seen • Nonplanar projections needed for applications such as map construction • But how big is Greenland?

  10. View Projection • We want to create a picture of the scene viewed from the camera • Two sorts of projection • Parallel projection • Perspective projection

  11. Moving COP to Infinity • as COP moves away, lines approach parallel • when COP at infinity, orthographic view

  12. Projections. • Two classes of projections : • Perspective. • Parallel. Parallel A Parallel A A A Centre of Projection. B B B Centre of Projection at infinity B Perspective

  13. Perspective projection is useful for ‘non technical’ communications Perspective renderings for marketing, etc. are readily obtained with computer-aided drawing (CAD) systems

  14. Perspective Projections. • Defined by projection plane and centre of projection. • Visual effect is termed perspective foreshortening. • The size of the projection of an object varies inversely with distance from the centre of projection. • Similar to a camera - Looks realistic ! • Not useful for metric information • Parallel lines do not in general project as parallel. • Angles only preserved on faces parallel to the projection plane. • Distances not preserved

  15. Remember The Big Idea

  16. Perspective Projections • A set of lines not parallel to the projection plane converge at a vanishing point. • Can be thought of in 3D as the projection of a point at infinity. • Homogeneous coordinate is 0 (x,y,0)

  17. 1-Point Projection Projection plane cuts 1 axis only.

  18. One-point Perspective • One principal face is parallel to the projection plane

  19. 1-Point Perspective A painting (The Piazza of St. Mark, Venice) done by Canaletto in 1735-45 in one-point perspective

  20. Two-point Perspective • One principal direction (i.e. axis) is parallel to the projection plane

  21. y z x Projection plane 2-Point Perspective

  22. 2-Point Perspective Painting in two point perspective by Edward Hopper The Mansard Roof 1923 (240 Kb); Watercolor on paper, 13 3/4 x 19 inches; The Brooklyn Museum, New York

  23. Three-point Perspective • Nothing parallel to the projection plane • Usually used when looking up at or down on buildings

  24. y z x Projection plane 3-Point Perspective Generally held to add little beyond 2-point perspective. A painting (City Night, 1926) by Georgia O'Keefe, that is approximately in three-point perspective.

  25. 3 points

  26. Perspective Projection – Simplest Case Centre of projection at the origin, Projection plane at z=d. Projection Plane. y P(x,y,z) x Pp(xp,yp,d) z d

  27. y axis P=(x, y, z) (xp, yp, zp) (xprp, yprp, zprp) View Plane z axis x axis Projection Calculations

  28. Review: Basic Perspective Projection similar triangles P(x,y,z) y P(x’,y’,z’) z z’=d homogeneous coords

  29. Perspective Projection

  30. Perspective Projection

  31. Types Of Projections • For anyone who did engineering or technical drawing

  32. Parallel Projections • Specified by a direction to the centre of projection, rather than a point. • Centre of projection at infinity. • Orthographic • The normal to the projection plane is the same as the direction to the centre of projection. • Oblique • Directions are different.

  33. Orthographic Projections Most common orthographic Projection : Front-elevation, Side-elevation, Plan-elevation. Angle of projection parallel to principal axis; projection plane is perpendicular to axis. Commonly used in technical drawings

  34. Orthographic Projection Orthographic Projection onto a plane at z = 0. xp = x , yp = y , z = 0.

  35. Isometric Projection • Projection plane normal makes equal angles with each axis. • i.e normal is (dx,dy,dz), |dx| = |dy|=|dz| • Only 8 directions that satisfy this condition.

  36. y y 120º 120º 120º x z x All 3 axes equally foreshortened • measurements can be made • Hence the name iso-metric Projection Plane z Isometric Projection Normal

  37. Orthographic Derivation • scale, translate, reflect for new coord sys

  38. Orthographic Derivation • scale, translate, reflect for new coord sys

  39. Orthographic Derivation • scale, translate, reflect for new coord sys

  40. Orthographic Derivation • scale, translate, reflect for new coord sys

  41. Orthographic OpenGL glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(left,right,bot,top,near,far);

  42. Isometric Projections • Isometric projections have been used in computer games from the very early days of the industry up to today Q*Bert Sim City Virtual Magic Kingdom

  43. Oblique projections. • Projection plane normal differs from the direction of projection. • Usually the projection plane is normal to a principal axis. • Projection of a face parallel to this plane allows measurement of angles and distance. • Other faces can measure distance, but not angles. • Frequently used in textbooks : easy to draw !

  44. Oblique Projection • Direction of projection is not perpendicular to the viewing plane • Most general parallel projection • Is this possible with a normal camera?

  45. Oblique projection Normal Parallel to x axis y x Projection Plane z

  46. Geometry of Oblique Projections • Point P=(0,0,1) maps to: P’=(l.cosa, l.sina, 0) on xy plane, and P(x,y,z) onto P’(xp,yp,0) and

  47. Orthographic Examples • How would you map an arbitrary bounding volume (nearxyz, farxyz) into the volume defined by (-1, -1, -1) and (1, 1, 1)?

  48. Quiz • I sat in the car, and realized the side mirror is 0.4m on my right and 0.3m in my front • I started my car and drove 5m forward, turned 30 degrees to right, moved 5m forward again, and turned 45 degrees to the right, and stopped • What is the position of the side mirror now, relative to where I was sitting in the beginning?

More Related