Projections and Hidden Surface Removal

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
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.
1 Chapter 5 Viewing. 2 Perspective Projection 3 Parallel Projection.
Computer Graphics (fall 2009)
1 Projection Matrices. 2 Objectives Derive the projection matrices used for standard OpenGL projections Introduce oblique projections Introduce projection.
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.
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.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Classical Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis.
Classical Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Viewing and Projection
Viewing and Projection
CS5500 Computer Graphics April 23, Today’s Topic Details of the front-end of the 3D pipeline: –How to construct the viewing matrix? –How to construct.
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
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.
Perspective projection
Viewing.
Coordinate Change.
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
CSC461: Lecture 19 Computer Viewing
Classical Viewing Ed Angel
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Models and Architectures
Models and Architectures
Fundamentals of Computer Graphics Part 5 Viewing
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University View & Projection.
Introduction to Computer Graphics with WebGL
Isaac Gang University of Mary Hardin-Baylor
Introduction to Computer Graphics with WebGL
Models and Architectures
Introduction to Computer Graphics with WebGL
Chap 3 Viewing Pipeline Reading:
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
University of New Mexico
Viewing (Projections)
Computer Graphics Computer Viewing
Computer Viewing Ed Angel Professor Emeritus of Computer Science
Isaac Gang University of Mary Hardin-Baylor
Viewing and Projection
Viewing and Projection
Presentation transcript:

Projections and Hidden Surface Removal Angel 5.4-5.6 Angel: Interactive Computer Graphics5E © Addison-Wesley 2009

Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Objectives To discuss projection matrices to achieve desired perspective Discuss OpenGL API to achieve desired perspectives Explore hidden surface removal APIs in OpenGL Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009

Projections and Normalization The default projection in the eye (camera) frame is orthogonal For points within the default view volume Most graphics systems use view normalization All other views are converted to the default view by transformations that determine the projection matrix Allows use of the same pipeline for all views xp = x yp = y zp = 0 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009

Homogeneous Coordinate Representation default orthographic projection xp = x yp = y zp = 0 wp = 1 pp = Mp M = In practice, we can let M = I and set the z term to zero later Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009

Angel: Interactive Computer Graphics5E © Addison-Wesley 2009 Camera Setups Angel: Interactive Computer Graphics5E © Addison-Wesley 2009

Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Simple Perspective Center of projection at the origin Projection plane z = d, d < 0 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009

Perspective Equations Consider top and side views xp = yp = zp = d Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009

Perspective Transformation Projection process Division by z Non-uniform foreshortening Farther from COP are smaller Closer to COP are larger Transform (x,y,z) to (xp, yp, zp) Irreversible All points along projector results to same point Angel: Interactive Computer Graphics5E © Addison-Wesley 2009

Homogeneous Coordinates If w != 0 Angel: Interactive Computer Graphics5E © Addison-Wesley 2009

Homogeneous Coordinate Form consider q = Mp where M = p =  q = Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009

Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Perspective Division However w  1, so we must divide by w to return from homogeneous coordinates This perspective division yields the desired perspective equations We will consider the corresponding clipping volume with the OpenGL functions xp = yp = zp = d Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009

Perspective Division (cont) Angel: Interactive Computer Graphics5E © Addison-Wesley 2009

Orthogonal Projection Angel: Interactive Computer Graphics5E © Addison-Wesley 2009

OpenGL Orthogonal Viewing glOrtho(left,right,bottom,top,near,far) near and far measured from camera Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009

Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 OpenGL Perspective glFrustum(left,right,bottom,top,near,far) Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009

Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Using Field of View With glFrustum it is often difficult to get the desired view gluPerpective(fovy, aspect, near, far) often provides a better interface front plane aspect = w/h Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009