Computer Graphics Bing-Yu Chen National Taiwan University.

Slides:



Advertisements
Similar presentations
Computer Graphics - Viewing -
Advertisements

Three Dimensional Viewing
Projection.
1 View Shandong University Software College Instructor: Zhou Yuanfeng
Three-Dimensional Viewing Sang Il Park Sejong University Lots of slides are stolen from Jehee Lee’s.
Now Playing: Coulibaly Amadou & Mariam from Dimanche a Bamako Released August 2, 2005.
Classical Viewing CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
3D Concepts UNIT 3. 3-D Coordinate Spaces Remember what we mean by a 3-D coordinate space x axis y axis z axis P y z x Right-Hand Reference System.
1 Chapter 5 Viewing. 2 Perspective Projection 3 Parallel Projection.
Computer Graphics (fall 2009)
Advanced Computer Graphics Three Dimensional Viewing
Transformation & Projection Feng Yu Proseminar Computer Graphics :
Computer Graphics I, Fall 2010 Classical Viewing.
CS559: Computer Graphics Lecture 9: Projection Li Zhang Spring 2008.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Viewing Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
1 E. Angel and D. Shreiner : Interactive Computer Graphics 6E © Addison-Wesley 2012 Classical Viewing Sai-Keung Wong ( 黃世強 ) Computer Science National.
Chapter 5 Viewing.
1 Classical Viewing. 2 Objectives Introduce the classical views Compare and contrast image formation by computer with how images have been formed by architects,
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 67 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 67 Computer Graphics Three-Dimensional Graphics III.
Graphics Graphics Korea University cgvr.korea.ac.kr 3D Viewing 고려대학교 컴퓨터 그래픽스 연구실.
CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 5.
Demetriou/Loizidou – ACSC330 – Chapter 5 Viewing Dr. Giorgos A. Demetriou Computer Science Frederick Institute of Technology.
CS5500 Computer Graphics March 12, 2007.
University of North Carolina at Greensboro
2003CS Hons RW778 Graphics1 Chapter 7: Three-Dimensional Viewing Chapter 5: Camera with parallel projection Chapter 5: Camera with parallel projection.
Graphics Graphics Korea University kucg.korea.ac.kr Viewing 고려대학교 컴퓨터 그래픽스 연구실.
Jinxiang Chai CSCE 441 Computer Graphics 3-D Viewing 0.
Three-Dimensional Viewing
Three-Dimensional Viewing Hearn & Baker Chapter 7
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Classical Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Rendering Pipeline Fall, D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.
Classical Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
CS552: Computer Graphics Lecture 11: Orthographic Projection.
1 PTT 105/3: Engineering Graphics. TAXONOMY OF PLANAR GEOMETRIC PROJECTIONS PTT 105/3: Engineering Graphics 2 Planar Geometric Projections Parallel Multiview.
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Classical Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Viewing Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Viewing. Classical Viewing Viewing requires three basic elements - One or more objects - A viewer with a projection surface - Projectors that go from.
Computer Graphics Projections.
Viewing in 3D Lecture 11. Viewing in 3D2 u The 3D viewing process is inherently more complex than is the 2D viewing process. F In 2D, we simply specify.
PROJECTIONS PROJECTIONS 1. Transform 3D objects on to a 2D plane using projections 2 types of projections Perspective Parallel In parallel projection,
3D Viewing and Clipping Ming Ouhyoung 歐陽明 Professor Dept. of CSIE and GINM NTU.
CS552: Computer Graphics Lecture 9: Perspective Projection.
Chapter 11 Three-Dimensional Geometric and Modeling Transformations
Three Dimensional Viewing
Rendering Pipeline Fall, 2015.
University of North Carolina at Greensboro
Projection Our 3-D scenes are all specified in 3-D world coordinates
3D Viewing cgvr.korea.ac.kr.
Prof. Lizhuang Ma Shanghai Jiao Tong University
CSCE 441 Computer Graphics 3-D Viewing
CSC461: Lecture 18 Classical Viewing
Viewing in 3D Chapter 6.
Unit 4 3D Viewing Pipeline Part - 2
CSC461: Lecture 19 Computer Viewing
Classical Viewing Ed Angel
Isaac Gang University of Mary Hardin-Baylor
Introduction to Computer Graphics with WebGL
Three Dimensional Viewing
Planar Geometric Projection Classes
3D Graphics.
Viewing (Projections)
Viewing (Projections)
Prof. Lizhuang Ma Shanghai Jiao Tong University
PROJECTIONS KOYEL DATTA GUPTA.
University of New Mexico
Isaac Gang University of Mary Hardin-Baylor
Presentation transcript:

Computer Graphics Bing-Yu Chen National Taiwan University

Viewing in 3D  3D Viewing Process  Classical Viewing and Projections  3D Synthetic Camera Model  Parallel Projection  Perspective Projection  3D Clipping for Canonical View Volume 1

3D Viewing Process Transform into viewport in 2D device coordinates for display Project onto projection plane Clip against view volume 2D device coordinates Clipped world coordinates 3D world-coordinate output primitives 2

Classical Viewing  Viewing requires three basic elements One or more objects A viewer with a projection surface Projectors that go from the object(s) to the projection surface  Classical views are based on the relationship among these elements The viewer picks up the object and orients it how she would like to see it  Each object is assumed to constructed from flat principal faces Buildings, polyhedra, manufactured objects 3

Planar Geometric Projections  Standard projections project onto a plane  Projectors are lines that either converge at a center of projection are parallel  Such projections preserve lines but not necessarily angles  Nonplanar projections are needed for applications such as map construction 4

Classical Projections Front elevationElevation oblique Plan oblique Isometric One-point perspective Three-point perspective 5

 The synthetic camera model involves two components, specified independently: objects (a.k.a geometry) viewer (a.k.a camera) 3D Synthetic Camera Model 6

Imaging with the Synthetic Camera center of projection image plane projector P projection of P  The image is rendered onto an image plane or project plane (usually in front of the camera).  Projectors emanate from the center of projection (COP) at the center of the lens (or pinhole).  The image of an object point P is at the intersection of the projector through P and the image plane. 7

Specifying a Viewer  Camera specification requires four kinds of parameters: Position: the COP. Orientation: rotations about axes with origin at the COP. Focal length: determines the size of the image on the film plane, or the field of view. Film plane: its width and height, and possibly orientation. 8

Projections  Projections transform points in n-space to m-space, where m < n.  In 3D, we map points from 3-space to the projection plane (PP) along projectors emanating from the center of projection (COP).  There are two basic type of projections: Perspective – distance from COP to PP finite Parallel – distance from COP to PP infinite COP PP 9

Perspective vs. Parallel Projections  Computer graphics treats all projections the same and implements them with a single pipeline  Classical viewing developed different techniques for drawing each type of projection  Fundamental distinction is between parallel and perspective viewing even though mathematically parallel viewing is the limit of perspective viewing 10

Perspective vs. Parallel Projections 11

Taxonomy of Planar Geometric Projections parallel perspective axonometric multiview orthographic oblique isometricdimetrictrimetric 2 point1 point3 point planar geometric projections 12

Orthographic Projection Projectors are orthogonal to projection surface 13

Multiview Orthographic Projection  Projection plane parallel to principal face  Usually form front, top, side views isometric (not multiview orthographic view) front side top in CAD and architecture, we often display three multiviews plus isometric 14

Advantages and Disadvantages  Preserves both distances and angles Shapes preserved Can be used for measurements  Building plans  Manuals  Cannot see what object really looks like because many surfaces hidden from view Often we add the isometric 15

Axonometric Projections classify by how many angles of a corner of a projected cube are the same none: trimetric two: dimetric three: isometric  1  3  2 Allow projection plane to move relative to object 16

Types of Axonometric Projections IsometricTrimetricDimetric 17

Advantages and Disadvantages  Lines are scaled (foreshortened) but can find scaling factors  Lines preserved but angles are not Projection of a circle in a plane not parallel to the projection plane is an ellipse  Can see three principal faces of a box-like object  Some optical illusions possible Parallel lines appear to diverge  Does not look real because far objects are scaled the same as near objects  Used in CAD applications 18

Oblique Projection Arbitrary relationship between projectors and projection plane 19

Advantages and Disadvantages  Can pick the angles to emphasize a particular face Architecture: plan oblique, elevation oblique  Angles in faces parallel to projection plane are preserved while we can still see “ around ” side  In physical world, cannot create with simple camera; possible with bellows camera or special lens (architectural) 20

Specification of an Arbitrary 3D View  VRP: view reference point  VPN: view-plane normal  VUP: view-up vector n u VUP VPN VRP v View plane 21

VRC: the viewing-reference coordinate system  CW: center of the window n u VPN VRP v CW View plane (u max,v max ) (u min,v min ) 22

Infinite Parallelepiped View Volume  DOP: direction of projection  PRP: projection reference point PRP DOP CW View plane n VPN VRP 23

Truncated View Volume for an Orthographic Parallel Projection 24

The Mathematics of Orthographic Parallel Projection y x z z P(x, y, z) ypyp xpxp View along x axis View along y axis Projection plane Projection plane 25

The Steps of Implementation of Orthographic Parallel Projection  Translate the VRP to the origin  Rotate VRC such that the VPN becomes the z axis  Shear such that the DOP becomes parallel to the z axis  Translate and scale into the parallel-projection canonical view volume 26

Perspective Projection Projectors converge at center of projection 27

Truncated View Volume for an Perspective Projection 28

Perspective Projection (Pinhole Camera) y x z z P(x, y, z) d d ypyp xpxp View along x axis View along y axis Projection plane Projection plane 29

Perspective Division However W  1, so we must divide by W to return from homogeneous coordinates 30

The Steps of Implementation of Perspective Projection  Translate the VRP to the origin  Rotate VRC such that the VPN becomes the z axis  Translate such that the PRP is at the origin  Shear such that the DOP becomes parallel to the z axis  Scale such that the view volume becomes the canonical perspective view volume 31

Alternative Perspective Projection y z z P(x, y, z) d d ypyp xpxp View along x axis View along y axis Projection plane at z=0 Projection plane at z=0 32

Vanishing Points  Parallel lines (not parallel to the projection plan) on the object converge at a single point in the projection (the vanishing point)  Drawing simple perspectives by hand uses these vanishing point(s) vanishing point 33

Three-Point Perspective  No principal face parallel to projection plane  Three vanishing points for cube 34

Two-Point Perspective  On principal direction parallel to projection plane  Two vanishing points for cube 35

One-Point Perspective  One principal face parallel to projection plane  One vanishing point for cube 36

Advantages and Disadvantages  Objects further from viewer are projected smaller than the same sized objects closer to the viewer (diminuition) Looks realistic  Equal distances along a line are not projected into equal distances (nonuniform foreshortening)  Angles preserved only in planes parallel to the projection plane  More difficult to construct by hand than parallel projections (but not more difficult by computer) 37

Canonical View Volume for Orthographic Parallel Projection  x = -1, y = -1, z = 0  x = 1, y = 1, z = z x or y Back plane Front plane 38

The Extension of the Cohen-Sutherland Algorithm  bit 1 – point is above view volume y > 1  bit 2 – point is below view volume y < -1  bit 3 – point is right of view volume x > 1  bit 4 – point is left of view volume x < -1  bit 5 – point is behind view volume z < -1  bit 6 – point is in front of view volume z > 0 39

Intersection of a 3D Line  a line from to can be represented as  so when y = 1 40

Canonical View Volume for Perspective Projection  x = z, y = z, z = -z min  x = -z, y = -z, z = z x or y Back plane Front plane 41

The Extension of the Cohen-Sutherland Algorithm  bit 1 – point is above view volume y > -z  bit 2 – point is below view volume y < z  bit 3 – point is right of view volume x > -z  bit 4 – point is left of view volume x < z  bit 5 – point is behind view volume z < -1  bit 6 – point is in front of view volume z > z min 42

Intersection of a 3D Line  so when y = z 43

Clipping in Homogeneous Coordinates  Why clip in homogeneous coordinates ? it is possible to transform the perspective-projection canonical view volume into the parallel-projection canonical view volume 44

Clipping in Homogeneous Coordinates  The corresponding plane equations are X = -W X = W Y = -W Y = W Z = -W Z = 0 45