University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Projections II Week 4,

Slides:



Advertisements
Similar presentations
Computer Graphics - Viewing -
Advertisements

Lecture 3: Transformations and Viewing. General Idea Object in model coordinates Transform into world coordinates Represent points on object as vectors.
1 Computer Graphics Chapter 8 3D Transformations.
Three-Dimensional Viewing Sang Il Park Sejong University Lots of slides are stolen from Jehee Lee’s.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Viewing/Projections I.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Prog 2, Kangaroo Hall.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner Viewing/Projections IV.
Transformations II Week 2, Wed Jan 17
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner Viewing/Projections III.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Viewing/Projections II.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Viewing/Projections III.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Lighting and Shading Week.
University of British Columbia CPSC 314 Computer Graphics May-June 2005 Tamara Munzner Viewing, Projections.
Based on slides created by Edward Angel
Viewing and Projections
Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 5: Viewing
Projections and Picking Wed 24 Sep 2003
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Viewing and Projections Wed 17 Oct 2003 project 1 recap: display lists viewing.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner Viewing/Projections I.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Viewing and Projections Mon 22 Sep 2003 project 1 solution demo recap: projections.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Midterm Review Week 7, Wed 16 Oct 2003 midterm review project 1 demos, hall.
1 Chapter 5 Viewing. 2 Perspective Projection 3 Parallel Projection.
Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)
Projection Projection - the transformation of points from a coordinate system in n dimensions to a coordinate system in m dimensions where m
Viewing and Projections
Computer Graphics (fall 2009)
2 COEN Computer Graphics I Evening’s Goals n Discuss the mathematical transformations that are utilized for computer graphics projection viewing.
CS559: Computer Graphics Lecture 9: Projection Li Zhang Spring 2008.
Graphics Graphics Korea University cgvr.korea.ac.kr 3D Viewing 고려대학교 컴퓨터 그래픽스 연구실.
CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 5.
CS 450: COMPUTER GRAPHICS PROJECTIONS SPRING 2015 DR. MICHAEL J. REALE.
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.
Chapters 5 2 March Classical & Computer Viewing Same elements –objects –viewer –projectors –projection plane.
Three-Dimensional Viewing
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 5: Viewing
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
©2005, Lee Iverson Lee Iverson UBC Dept. of ECE EECE 478 Viewing and Projection.
Viewing
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.
Taxonomy of Projections FVFHP Figure Taxonomy of Projections.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Viewing/Projections IV.
Viewing and Projection
CS552: Computer Graphics Lecture 11: Orthographic Projection.
Coordinate Systems Lecture 1 Fri, Sep 2, The Coordinate Systems The points we create are transformed through a series of coordinate systems before.
Viewing and Projection. The topics Interior parameters Projection type Field of view Clipping Frustum… Exterior parameters Camera position Camera orientation.
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.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner Viewing/Projections I.
Rendering Pipeline Fall, 2015.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016
University of North Carolina at Greensboro
CSE 167 [Win 17], Lecture 5: Viewing Ravi Ramamoorthi
3D Viewing cgvr.korea.ac.kr.
Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics
CSCE 441 Computer Graphics 3-D Viewing
CSC461: Lecture 20 Parallel Projections in OpenGL
Viewing/Projections I Week 3, Fri Jan 25
OpenGL 2D Viewing Pipeline
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University View & Projection.
Computer Graphics (Spring 2003)
Viewing II Week 4, Mon Jan 25
Chap 3 Viewing Pipeline Reading:
Viewing III Week 4, Wed Jan 27
Viewing/Projections I Week 3, Fri Jan 25
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016
Presentation transcript:

University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Projections II Week 4, Wed Jan 26

2 Reading (Mon and today) FCG Section rest of Chapter 6 RB rest of Chapter Viewing rest of Appendix Homogeneous Coords

3 Review: Graphics Cameras real pinhole camera: image inverted imageplane eye point point computer graphics camera: convenient equivalent imageplane eye point point center of projection

4 Review: Basic Perspective Projection similar triangles z P(x,y,z) P(x’,y’,z’) z’=d y homogeneouscoords

5 Review: Orthographic Cameras center of projection at infinity no perspective convergence just throw away z values

6 Review: Transforming View Volumes x z NDCS y (-1,-1,-1) (1,1,1) orthographic view volume x z VCS y x=left y=top x=right z=-far z=-near y=bottom perspective view volume x=left x=right y=top y=bottom z=-near z=-far x VCS y

7 Review: Ortho to NDC Derivation scale, translate, reflect for new coord sys x z VCS y x=left y=top x=right z=-far z=-near y=bottom x z NDCS y (-1,-1,-1) (1,1,1)

8 NDC to Viewport Transformation generate pixel coordinates map x, y from range –1…1 (NDC) to pixel coordinates on the display involves 2D scaling and translation x y display viewport

9 NDC to Viewport Transformation (-1,-1) (1,1) (0,0) (w,h) NDCS DCS glViewport(x,y,a,b); default : a b x y glViewport(0,0,w,h); OpenGL 2D scaling and translation

10 Origin Location yet more possibly confusing conventions OpenGL: lower left most window systems: upper left often have to flip your y coordinates when interpreting mouse position

11 Perspective Example tracks in VCS: left x=-1, y=-1 right x=1, y=-1 view volume left = -1, right = 1 bot = -1, top = 1 near = 1, far = 4 z=-1 z=-4 x z VCS top view 1 1 NDCS (z not shown) real midpoint 0 xmax-1 0 DCS (z not shown) ymax-1 x=-1 x=1

12 Viewing Transformation OCS WCS VCSmodelingtransformationviewingtransformation OpenGL ModelView matrix objectworld viewing y x VCS Peye z y x WCS y z OCS image plane

13 Projective Rendering Pipeline OCS - object coordinate system WCS - world coordinate system VCS - viewing coordinate system CCS - clipping coordinate system NDCS - normalized device coordinate system DCS - device coordinate system OCS WCS VCS CCS NDCS DCSmodelingtransformationviewingtransformationprojectiontransformationviewporttransformation alter w / w objectworld viewing device normalized device clipping perspectivedivision

14 Projective Rendering Pipeline OCS - object coordinate system WCS - world coordinate system VCS - viewing coordinate system CCS - clipping coordinate system NDCS - normalized device coordinate system DCS - device coordinate system OCS WCS VCS CCS NDCS DCSmodelingtransformationviewingtransformationprojectiontransformationviewporttransformation alter w / w objectworld viewing device normalized device clipping perspectivedivision

15 Perspective Projection specific example assume image plane at z = -1 a point [x,y,z,1] T projects to [-x/z,-y/z,-z/z,1] T  [x,y,z,-z] T -z

16 Perspective Projection alter w / w projectiontransformation perspectivedivision

17 Canonical View Volumes standardized viewing volume representation orthographic perspective orthogonal parallel x or y -z x or y -z 1 Front Plane front plane back plane x or y = +/- z

18 Why Canonical View Volumes? permits standardization clipping easier to determine if an arbitrary point is enclosed in volume consider clipping to six arbitrary planes of a viewing volume versus canonical view volume rendering projection and rasterization algorithms can be reused

19 Projection Normalization one additional step of standardization warp perspective view volume to orthogonal view volume render all scenes with orthographic projection! x z=  z=d x z=0 z=d

20 Predistortion

21 Perspective Normalization perspective viewing frustum transformed to cube orthographic rendering of cube produces same image as perspective rendering of original frustum

22 Demos Tuebingen applets from Frank Hanisch AppletIndex.html#Transformationen

Perspective Warp matrix formulation preserves relative depth (third coordinate) what does mean?

24 Projection Normalization distort such that orthographic projection of distorted objects is desired persp projection separate division from standard matrix multiplies clip after warp, before divide division: normalization CCS NDCS alter w / w VCS projectiontransformation viewing normalized device clipping perspectivedivision

25 Projective Rendering Pipeline OCS - object coordinate system WCS - world coordinate system VCS - viewing coordinate system CCS - clipping coordinate system NDCS - normalized device coordinate system DCS - device coordinate system OCS WCS VCS CCS NDCS DCSmodelingtransformationviewingtransformationprojectiontransformationviewporttransformation alter w / w objectworld viewing device normalized device clipping perspectivedivision glVertex3f(x,y,z) glTranslatef(x,y,z)glRotatef(th,x,y,z)....gluLookAt(...) glFrustum(...) glutInitWindowSize(w,h)glViewport(x,y,a,b)

26 Coordinate Systems

27 Perspective Derivation x z NDCS y (-1,-1,-1) (1,1,1) x=left x=right y=top y=bottom z=-near z=-far x VCS y z

28 Perspective Derivation earlier: complete: shear, scale, projection-normalization

29 Perspective Derivation

30 Perspective Derivation similarly for other 5 planes 6 planes, 6 unknowns

31 Perspective Example view volume left = -1, right = 1 bot = -1, top = 1 near = 1, far = 4

32 Perspective Example / w

33 Asymmetric Frusta our formulation allows asymmetry why bother? -z x Frustum right left -z x Frustum z=-n z=-f right left

34 Simpler Formulation left, right, bottom, top, near, far nonintuitive often overkill look through window center symmetric frustum constraints left = -right, bottom = -top

35 Field-of-View Formulation FOV in one direction + aspect ratio (w/h) determines FOV in other direction also set near, far (reasonably intuitive) -z x Frustum z=-n z=-f  fovx/2 fovy/2 h w

36 Perspective OpenGL glMatrixMode(GL_PROJECTION); glLoadIdentity(); glFrustum(left,right,bot,top,near,far); or glPerspective(fovy,aspect,near,far);

37 Demo: Frustum vs. FOV Nate Robins tutorial (take 2):

38 Projection Taxonomy planarprojections perspective:1,2,3-point parallel oblique orthographic cabinet cavalier top,front,side axonometric:isometricdimetrictrimetric

39 Perspective Projections one-pointperspective two-pointperspective three-pointperspective classified by vanishing points

Parallel Projection projectors are all parallel vs. perspective projectors that converge orthographic: projectors perpendicular to projection plane oblique: projectors not necessarily perpendicular to projection plane ObliqueOrthographic

41 Axonometric Projections projectors perpendicular to image plane select axis lengths

42 Oblique Projections x y z cavalier d d x y z cabinet d d / 2 projectors oblique to image plane select angle between front and z axis lengths remain constant both have true front view cavalier: distance true cabinet: distance half

43 Demos Tuebingen applets from Frank Hanisch AppletIndex.html#Transformationen