Perspective projection

Slides:



Advertisements
Similar presentations
Computer Graphics - Viewing -
Advertisements

Three Dimensional Viewing
1 Computer Graphics Chapter 8 3D Transformations.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Transformations II Week.
Based on slides created by Edward Angel
Viewing Doug James’ CG Slides, Rich Riesenfeld’s CG Slides, Shirley, Fundamentals of Computer Graphics, Chap 7 Wen-Chieh (Steve) Lin Institute of Multimedia.
Introduction to 3D viewing 3D is just like taking a photograph!
I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 23, D Viewing III 3D Viewing III.
I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 22, D Viewing III Kansas State University CIS 636 Fundamentals.
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
CS559: Computer Graphics Lecture 9: Projection Li Zhang Spring 2008.
C O M P U T E R G R A P H I C S Jian Chen January 15, 2010 Viewing III 1/42 3D Viewing III By Andries van Dam.
CS-378: Game Technology Lecture #2.1: Projection Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic, Jessica.
Computer Graphics Bing-Yu Chen National Taiwan University.
Computing & Information Sciences Kansas State University CIS 536/636 Introduction to Computer Graphics Lecture 5 of 41 William H. Hsu Department of Computing.
CS 450: COMPUTER GRAPHICS PROJECTIONS SPRING 2015 DR. MICHAEL J. REALE.
OpenGL The Viewing Pipeline: Definition: a series of operations that are applied to the OpenGL matrices, in order to create a 2D representation from 3D.
Basic Perspective Projection Watt Section 5.2, some typos Define a focal distance, d, and shift the origin to be at that distance (note d is negative)
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Three-Dimensional Viewing Hearn & Baker Chapter 7
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
Graphics CSCI 343, Fall 2015 Lecture 16 Viewing I
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Classical Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Taxonomy of Projections FVFHP Figure Taxonomy of Projections.
A Photograph of two papers
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Viewing and Projection. The topics Interior parameters Projection type Field of view Clipping Frustum… Exterior parameters Camera position Camera orientation.
Lecture 14: Projection CS4670 / 5670: Computer Vision Noah Snavely “The School of Athens,” Raphael.
CS 551 / 645: Introductory Computer Graphics Viewing Transforms.
Viewing Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
CS5500 Computer Graphics March 20, Computer Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts.
OpenGL LAB III.
Viewing. Classical Viewing Viewing requires three basic elements - One or more objects - A viewer with a projection surface - Projectors that go from.
What you will learn about today
Chapter 11 Three-Dimensional Geometric and Modeling Transformations
Viewing Viewing and viewing space (camera space)
Viewing.
CSE 167 [Win 17], Lecture 3: Transformations 1 Ravi Ramamoorthi
Computer Viewing.
CSE 167 [Win 17], Lecture 5: Viewing Ravi Ramamoorthi
PERSPECTIVE PROJECTION…...
Projection Our 3-D scenes are all specified in 3-D world coordinates
Isaac Gang University of Mary Hardin-Baylor
CSCE 441 Computer Graphics 3-D Viewing
CSC461: Lecture 20 Parallel Projections in OpenGL
Modeling 101 For the moment assume that all geometry consists of points, lines and faces Line: A segment between two endpoints Face: A planar area bounded.
Lecture 9: Projection Li Zhang Spring 2008
2D Transformations y y x x y x.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016
CENG 477 Introduction to Computer Graphics
Projections and Normalization
CSC461: Lecture 19 Computer Viewing
Viewing/Projections I Week 3, Fri Jan 25
A Photograph of two papers
Three Dimensional Viewing
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University View & Projection.
Lecture 13: Cameras and geometry
Computer Graphics Lecture 20
Three-Dimensional Viewing
Projections and Hidden Surface Removal
Andries van Dam September 18, D Viewing III
What you will learn about today
Last Time Canonical view pipeline Projection Local Coordinate Space
Viewing (Projections)
University of New Mexico
Viewing (Projections)
Computer Graphics 3Practical Lesson
Rendering – Matrix Transformations and the Graphics Pipeline
Guilford County SciVis V part 1
Presentation transcript:

Perspective projection Prepared by Cindy Grimm and Ken Goldman for Washington University CSE131 based on slides to accompany Fundamentals of Interactive Computer Graphics by Foley and Van Dam

Properties of perspective projection edges same size, with farther ones smaller Straight lines go to straight lines Closer objects are bigger Parallel lines Stay parallel (lines are perpendicular to viewer) Converge to a vanishing point (lines are not perpendicular to viewer) parallel edges converging Perspective projection

Perspective projection View volume What you can see View point (eye) View direction (projectors) projectors eye, or Center of Projection (COP) projectors picture plane Perspective projection

Perspective projection Specifying a camera Eye position (type: Point) Look direction (type: Vector) Up direction (type: Vector) Near/far (percentage along Look) (0.1, 1,000) Width Up vector Look vector y x Height Position z Near Far Perspective projection

Perspective projection Our camera Eye point is point on sphere. Given d (distance), q (latitude) and f (longitude), eye point is: Eyex = d cos(q) cos(f) Eyey = d sin(q) Eyez = d sin(f) cos(q) Up vector will always be (0,1,0) Note that sphere is oriented with the north/south poles in the y direction Look vector: looks at origin (Eye – (0,0,0)) Perspective projection

Perspective projection Mathematically… Projection is a 4x4 matrix Build from four component matrices, PSRT P: Perspective matrix Responsible for fore-shortening S: Scale matrix Adjusts for aspect ratio R: Rotation matrix Which direction to look at T: Translation matrix Where the camera is Perspective projection

Perspective projection near (0.1) far (1000) k = near/far Scales x,y by z P Flip the z-axis and unhinge Note: not 1! Perspective projection

Perspective projection Scale Pre-adjust for aspect ratio W: width of final image H: height of final image Aspect ratio: W/H Bring the far plane up Note: can put W/H in S(1,1) instead Perspective projection

Perspective projection Rotation Make the camera point at the origin Given: Eye (point) and Up (vector) = (0,1,0) r,u,n are orthogonal, unit length vectors Dot product of any pair is zero Length of each is one Perspective projection

Perspective projection Translation Move camera to position on sphere Why negative? Matrix needs to undo translation to bring camera to origin Perspective projection

Putting it all together Convert point (x,y,z) to 4x1 matrix by adding a one (homogeneous points) Note: Pre-multiply PSRT to make one 4x4 matrix which is applied to all points Perspective projection

Perspective projection To image space Divide by w to get point in camera space Anything with u/w,v/w in [-1,-1]x[1,1] and d/w in [0,1] is visible and in front of the camera If w=0 then point is “smeared” over all of the z=0 plane; one fix is to set u/w and v/w to be zero. Convert to image space by scaling by width and height Camera to image transformation Perspective projection