3D Viewing and Clipping Ming Ouhyoung 歐陽明 Professor Dept. of CSIE and GINM NTU.

Slides:



Advertisements
Similar presentations
Computer Graphics - Viewing -
Advertisements

Computer Graphics Lecture 8 Arbitrary Viewing II: More Projection, Clipping and Mathematics of 3D Viewing.
Three Dimensional Viewing
©Larry F. Hodges (modified by Amos Johnson) 1 Arbitrary 3-D View-Plane.
CS 325 Introduction to Computer Graphics 02 / 24 / 2010 Instructor: Michael Eckmann.
CS 376 Introduction to Computer Graphics 02 / 26 / 2007 Instructor: Michael Eckmann.
Classical Viewing CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
1 Chapter 5 Viewing. 2 Perspective Projection 3 Parallel Projection.
Visualization- Determining Depth From Stereo Saurav Basu BITS Pilani 2002.
Projection Projection - the transformation of points from a coordinate system in n dimensions to a coordinate system in m dimensions where m
CS 325 Introduction to Computer Graphics 03 / 03 / 2010 Instructor: Michael Eckmann.
Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may.
Computer Graphics (fall 2009)
Advanced Computer Graphics Three Dimensional Viewing
Transformation & Projection Feng Yu Proseminar Computer Graphics :
1 2D Transformations 几何变换. 2 What is a transformation? A transformation is an operation that transforms or changes a shape (line, drawing etc.) There.
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.
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 고려대학교 컴퓨터 그래픽스 연구실.
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.
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.
CS 376 Introduction to Computer Graphics 02 / 23 / 2007 Instructor: Michael Eckmann.
CS 325 Introduction to Computer Graphics 02 / 22 / 2010 Instructor: Michael Eckmann.
CS 325 Introduction to Computer Graphics 02 / 26 / 2010 Instructor: Michael Eckmann.
CS5500 Computer Graphics March 12, 2007.
2003CS Hons RW778 Graphics1 Chapter 7: Three-Dimensional Viewing Chapter 5: Camera with parallel projection Chapter 5: Camera with parallel projection.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
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.
Taxonomy of Projections FVFHP Figure Taxonomy of Projections.
CS 376 Introduction to Computer Graphics 02 / 21 / 2007 Instructor: Michael Eckmann.
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
Perspective View Volume View Volume Far Near Window Far Near Window Center of Projection Center of Projection (a) Original Orientation (b) After Transformation.
Viewing. Classical Viewing Viewing requires three basic elements - One or more objects - A viewer with a projection surface - Projectors that go from.
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,
Rendering Pipeline Fall, 2015.
Projection Our 3-D scenes are all specified in 3-D world coordinates
Prof. Lizhuang Ma Shanghai Jiao Tong University
CSCE 441 Computer Graphics 3-D Viewing
CSC461: Lecture 18 Classical Viewing
Viewing in 3D Chapter 6.
CSC461: Lecture 19 Computer Viewing
Viewing Rectangle Coordinates (VRC)
Classical Viewing Ed Angel
Isaac Gang University of Mary Hardin-Baylor
Introduction to Computer Graphics with WebGL
Three Dimensional Viewing
Viewing (Projections)
Viewing (Projections)
Prof. Lizhuang Ma Shanghai Jiao Tong University
THREE-DIMENSIONAL VIEWING
University of New Mexico
Isaac Gang University of Mary Hardin-Baylor
Viewing Transformations II
Presentation transcript:

3D Viewing and Clipping Ming Ouhyoung 歐陽明 Professor Dept. of CSIE and GINM NTU

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

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

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

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

Truncated View Volume for an Perspective Projection (how to do 3D clipping?)

Canonical View Volume for Perspective Projection: 3D clipping is easier this way! x = z, y = z, z = -z min x = -z, y = -z, z = z x or y Back plane Front plane

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

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

N per = S per * SH per * T(-PRP) * R * T(-VRP) T(-VRP) =T(0,0,0) where no oblique proj. T(-PRP) = T((0,0,d)) SH per =1, R=R y (180 o )= [ ] [ ] [ ] [ ]

S per (scaling)= Assuming back clipping plane = (U max, V max, B ) Front clipping plane = (U min, V min, Z min = F) For example, let U max = 5 = V max, B=10, F=-d+2 U min = -5 = V min, vrp z ‘ = d, where d=8

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

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)

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

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

Intersection of a 3D Line A line from to can be represented as So when y = 1

Intersection of a 3D Line So when y = z

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

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