Viewing and Projection

Slides:



Advertisements
Similar presentations
Computer Graphics - Viewing -
Advertisements

1 Computer Graphics Chapter 8 3D Transformations.
1 View Shandong University Software College Instructor: Zhou Yuanfeng
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Projection Matrices modified by Ray Wisman Ed Angel Professor of Computer.
Projection Matrices CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Based on slides created by Edward Angel
Viewing and Projections
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Computer Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Projection Matrices Ed Angel
Objectives Derive the perspective projection matrices used for standard OpenGL projections Derive the perspective projection matrices used for standard.
Viewing Doug James’ CG Slides, Rich Riesenfeld’s CG Slides, Shirley, Fundamentals of Computer Graphics, Chap 7 Wen-Chieh (Steve) Lin Institute of Multimedia.
1 Chapter 5 Viewing. 2 Perspective Projection 3 Parallel Projection.
Projection Projection - the transformation of points from a coordinate system in n dimensions to a coordinate system in m dimensions where m
Computer Graphics (fall 2009)
1 Projection Matrices. 2 Objectives Derive the projection matrices used for standard OpenGL projections Introduce oblique projections Introduce projection.
2 COEN Computer Graphics I Evening’s Goals n Discuss the mathematical transformations that are utilized for computer graphics projection viewing.
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.
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.
Computer Graphics Bing-Yu Chen National Taiwan University.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
University of Palestine Computer Graphics ITGD3107 Prepare: Mohammed J. el-masre Nidal M. El-Borbar Supervision:
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.
CAP4730: Computational Structures in Computer Graphics 3D Transformations.
Computer Graphics I, Fall 2010 Computer Viewing.
Viewing and Projection. 2 3 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009  Introduce the classical views  Compare and contrast image.
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.
University of North Carolina at Greensboro
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.
Chapters 5 2 March Classical & Computer Viewing Same elements –objects –viewer –projectors –projection plane.
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,
Classical Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Taxonomy of Projections FVFHP Figure Taxonomy of Projections.
Viewing and Projection
Transformations: Projection CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
CS-321 Dr. Mark L. Hornick 1 Three-Dimensional Graphics Problem How can you effectively display 3-D information on a 2-D display?
Viewing and Projection. The topics Interior parameters Projection type Field of view Clipping Frustum… Exterior parameters Camera position Camera orientation.
Classical Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
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.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Computer Viewing Isaac Gang University of Mary Hardin-Baylor.
Viewing. Classical Viewing Viewing requires three basic elements - One or more objects - A viewer with a projection surface - Projectors that go from.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Viewing.
Computer Viewing.
Isaac Gang University of Mary Hardin-Baylor
Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics
CSCE 441 Computer Graphics 3-D Viewing
CSC461: Lecture 20 Parallel Projections in OpenGL
Projections and Normalization
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Isaac Gang University of Mary Hardin-Baylor
Projection in 3-D Glenn G. Chappell
Projections and Hidden Surface Removal
Introduction to Computer Graphics with WebGL
Chap 3 Viewing Pipeline Reading:
Introduction to Computer Graphics with WebGL
University of New Mexico
Computer Viewing Ed Angel Professor Emeritus of Computer Science
Viewing and Projection
Viewing and Projection
Presentation transcript:

Viewing and Projection

Parallel Projection

Parallel Projections (known aliases): Orthographic or Isometric Projection

Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Oblique Projection Arbitrary relationship between projectors and projection plane Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009

Parallel Projections (known aliases): Oblique Projection  L 

Perspective Projection Projectors coverge at center of projection Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009

Perspective Projection foreshortening - the farther an object is from the camera , the smaller it appears in the final image

Perspective Projection The geometry of the situation is that of similar triangles. View from above: What is x’ ? P (x, y, z) X Z View plane (0,0,0) x’ = ? d

Perspective Projection Top View P=(xp,yp,zp) P’=(x’,y’,z’) CoP=(xc,yc,zc) xp x’ z’ zp

Angel: Interactive Computer Graphics 5 © Addison-Wesley 2009 Simple Perspective Consider a simple perspective with the COP at the origin, the near clipping plane at z = -1, and a 90 degree field of view determined by the planes x = z, y = z Angel: Interactive Computer Graphics 5 © Addison-Wesley 2009

Angel: Interactive Computer Graphics 5 © Addison-Wesley 2009 Perspective Matrices Simple projection matrix in homogeneous coordinates Note that this matrix is independent of the far clipping plane M = Angel: Interactive Computer Graphics 5 © Addison-Wesley 2009

Angel: Interactive Computer Graphics 5 © Addison-Wesley 2009 Generalization N = after perspective division, the point (x, y, z, 1) goes to x’’ = x/z y’’ = y/z Z’’ = -(a+b/z) which projects orthogonally to the desired point regardless of a and b Angel: Interactive Computer Graphics 5 © Addison-Wesley 2009

What the Perspective Matrix means Note: Normalized Device Coordinates are a LEFT-HANDED Coordinate system

Angel: Interactive Computer Graphics 5 © Addison-Wesley 2009 Picking a and b If we pick a = b = the near plane is mapped to z = -1 the far plane is mapped to z =1 and the sides are mapped to x =  1, y =  1 Hence the new clipping volume is the default clipping volume Angel: Interactive Computer Graphics 5 © Addison-Wesley 2009

Normalization Transformation distorted object projects correctly new clipping volume original object original clipping volume Angel: Interactive Computer Graphics 5 © Addison-Wesley 2009

Angel: Interactive Computer Graphics 5 © Addison-Wesley 2009 OpenGL Perspective glFrustum allows for an unsymmetric viewing frustum (although gluPerspective does not) Angel: Interactive Computer Graphics 5 © Addison-Wesley 2009

OpenGL Perspective Matrix The normalization in glFrustum requires an initial shear to form a right viewing pyramid, followed by a scaling to get the normalized perspective volume. Finally, the perspective matrix results in needing only a final orthogonal transformation P = NSH our previously defined perspective matrix shear and scale Angel: Interactive Computer Graphics 5 © Addison-Wesley 2009

glFrustum Matrix

Angel: Interactive Computer Graphics 5 © Addison-Wesley 2009 Why do we do it this way? Normalization allows for a single pipeline for both perspective and orthogonal viewing We stay in four dimensional homogeneous coordinates as long as possible to retain three-dimensional information needed for hidden-surface removal and shading We simplify clipping Angel: Interactive Computer Graphics 5 © Addison-Wesley 2009

What the Perspective Matrix means Note: Normalized Device Coordinates are a LEFT-HANDED Coordinate system

Graphics Pipeline So Far Object Object Coordinates Transformation Object -> World World World Coordinates Projection Xform World -> Projection Camera Projection Coordinates Normalize Xform & Clipping Projection -> Normalized Viewport Normalized Coordinates Viewport Transform Normalized -> Device Screen Device Coordinates

What happens to an object... Transformation Object -> World Object Object Coordinates World World Coordinates

What happens to an object... Transformation - Modelview World -> Eye/Camera World World Coordinates Viewport Viewport Coordinates

What happens to an object... Transformation - Projection (Includes Perspective Divide) Eye/Camera ->View Plane Viewport Viewport Coordinates Rasterization Scan Converting Triangles