Advanced Computer Graphics Three Dimensional Viewing

Slides:



Advertisements
Similar presentations
Computer Graphics - Viewing -
Advertisements

GR2 Advanced Computer Graphics AGR
Three Dimensional Viewing
Three-Dimensional Viewing Sang Il Park Sejong University Lots of slides are stolen from Jehee Lee’s.
Computer Graphics Viewing.
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,
CS 352: Computer Graphics Chapter 5: Viewing. Interactive Computer GraphicsChapter Overview Specifying the viewpoint Specifying the projection Types.
Course Website: Computer Graphics 9: Clipping In 3D.
4.1si31_2001 SI31 Advanced Computer Graphics AGR Lecture 4 Projection Clipping Viewport Transformation.
3D Concepts UNIT 3. 3-D Coordinate Spaces Remember what we mean by a 3-D coordinate space x axis y axis z axis P y z x Right-Hand Reference System.
OpenGL (II). How to Draw a 3-D object on Screen?
CHAPTER 7 Viewing and Transformations © 2008 Cengage Learning EMEA.
Introduction to 3D viewing 3D is just like taking a photograph!
12.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 12 – 3D Graphics Transformation Pipeline: Projection and Clipping.
Viewing and Projections
Computer Graphics (fall 2009)
02/26/02 (c) 2002 University of Wisconsin, CS 559 Last Time Canonical view pipeline Orthographic projection –There was an error in the matrix for taking.
UBI 516 Advanced Computer Graphics Three Dimensional Viewing
3D Viewing.
CS559: Computer Graphics Lecture 9: Projection Li Zhang Spring 2008.
Viewing Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Computer Graphics 2 – Dimensional 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.
Graphics Graphics Korea University cgvr.korea.ac.kr 3D Viewing 고려대학교 컴퓨터 그래픽스 연구실.
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.
Computer Graphics I, Fall 2010 Computer Viewing.
Programming 3D Applications CE Displaying Computer Graphics Week 3 Lecture 5 Bob Hobbs Faculty of Computing, Engineering and Technology Staffordshire.
Three-Dimensional Viewing Jehee Lee Seoul National University.
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.
2003CS Hons RW778 Graphics1 Chapter 7: Three-Dimensional Viewing Chapter 5: Camera with parallel projection Chapter 5: Camera with parallel projection.
Graphics Graphics Korea University kucg.korea.ac.kr Viewing 고려대학교 컴퓨터 그래픽스 연구실.
The Camera Analogy ► Set up your tripod and point the camera at the scene (viewing transformation) ► Arrange the scene to be photographed into the desired.
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.
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.
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.
CS 490: Computer Graphics Chapter 5: Viewing. Interactive Computer GraphicsChapter Overview Specifying the viewpoint Specifying the projection Types.
3D Viewing and Clipping Ming Ouhyoung 歐陽明 Professor Dept. of CSIE and GINM NTU.
CS552: Computer Graphics Lecture 12: 3D Clipping.
Viewing 고려대학교 컴퓨터 그래픽스 연구실 kucg.korea.ac.kr.
Chapter 11 Three-Dimensional Geometric and Modeling Transformations
Three Dimensional Viewing
Projection Our 3-D scenes are all specified in 3-D world coordinates
Computer Graphics Viewing
CSCE 441 Computer Graphics 3-D Viewing
3D Clipping.
Computer Graphics 9: Clipping In 3D
Three Dimensional Viewing
OpenGL 2D Viewing Pipeline
Perspective Transformation
3D Graphics.
Viewing (Projections)
Viewing (Projections)
Interactive Computer Graphics Viewing
THREE-DIMENSIONAL VIEWING II
THREE-DIMENSIONAL VIEWING
Viewing Transformations II
Presentation transcript:

Advanced Computer Graphics Three Dimensional Viewing

Overview Viewing a 3D scene Projections Parallel and perspective

Overview Surface rendering

Overview Exploded and cutaway views

Overview 3D and stereoscopic viewing

3D Viewing Pipeline MC DC Modeling Transformation Viewport Transformation NC WC Normalization Transformation and Clipping Viewing Transformation VC PC Projectionn Transformation

Viewing Coordinates Generating a view of an object in 3D is similar to photographing the object. Whatever appears in the viewfinder is projected onto the flat film surface. Depending on the position, orientation and aperture size of the camera corresponding views of the scene is obtained.

Specifying The View Coordinates xw zw yw xv zv yv P0=(x0 , y0 , z0) For a particular view of a scene first we establish viewing-coordinate system. A view-plane (or projection plane) is set up perpendicular to the viewing z-axis. World coordinates are transformed to viewing coordinates, then viewing coordinates are projected onto the view plane.

Specifying The View Coordinates To establish the viewing reference frame, we first pick a world coordinate position called the view reference point. This point is the origin of our viewing coordinate system. If we choose a point on an object we can think of this point as the position where we aim a camera to take a picture of the object.

Specifying The View Coordinates Next, we select the positive direction for the viewing z-axis, and the orientation of the view plane, by specifying the view-plane normal vector, N. We choose a world coordinate position P and this point establishes the direction for N. OpenGL establishes the direction for N using the point P as a look at point relative to the viewing coordinate origin. yv xv xv yw zv N P0 P xw zw

Specifying The View Coordinates Finally, we choose the up direction for the view by specifying view-up vector V. This vector is used to establish the positive direction for the yv axis. The vector V is perpendicular to N. Using N and V, we can compute a third vector U, perpendicular to both N and V, to define the direction for the xv axis. yv xv V yw zv N P0 P xw zw

Specifying The View Coordinates To obtain a series of views of a scene , we can keep the the view reference point fixed and change the direcion of N. This corresponds to generating views as we move around the viewing coordinate origin. P0 N N

Transformation From World To Viewing Coordinates Conversion of object descriptions from world to viewing coordinates is equivalent to transformation that superimpoes the viewing reference frame onto the world frame using the translation and rotation. xv yv zv yw xw zw

Transformation From World To Viewing Coordinates First, we translate the view reference point to the origin of the world coordinate system xv yv zv yw xw zw

Transformation From World To Viewing Coordinates Second, we apply rotations to align the xv,, yv and zv axes with the world xw, yw and zw axes, respectively. yw yv zv xv yv zv xv xw zw

Transformation From World To Viewing Coordinates If the view reference point is specified at word position (x0, y0, z0), this point is translated to the world origin with the translation matrix T.

Transformation From World To Viewing Coordinates The rotation sequence requires 3 coordinate-axis transformation depending on the direction of N. First we rotate around xw-axis to bring zv into the xw -zw plane.

Transformation From World To Viewing Coordinates Then, we rotate around the world yw axis to align the zw and zv axes.

Transformation From World To Viewing Coordinates The final rotation is about the world zw axis to align the yw and yv axes.

Transformation From World To Viewing Coordinates The complete transformation from world to viewing coordinate transformation matrix is obtaine as the matrix product

Transformation From World To Viewing Coordinates: An Example For 2d System 0 2 4 6 Θ=300 P0=(4,3) 0 2 4 6 x

Transformation From World To Viewing Coordinates: An Example For 2d System Translation: y 0 2 4 6 P 2 x′ 2 y′ 2 4 6 Θ=300 P0 x

Transformation From World To Viewing Coordinates: An Example For 2d System Rotation y x x′ y′ 2 4 6 P P0 0 2 4 6

Transformation From World To Viewing Coordinates: An Example For 2d System New coordinates

Transformation From World To Viewing Coordinates: An Example For 2d System Alternative Method y 0 1 2 3 P 1 x′ y′ 1 n v Θ=300 P0 1 2 3 x

Projections Once WC description of the objects in a scene are converted to VC we can project the 3D objects onto 2D view-plane. Two types of projections: -Parallel Projection -Perspective Projection

Classical Viewings Hand drawings : Determined by a specific relationship between the object and the viewer.

Parallel Projections Coordinate Positions are transformed to the view plane along parallel lines. View Plane P2 P′2 P1 P′1

Parallel Projections Orthographic parallel projection The projection is perpendicular to the view plane. Oblique parallel projecion The parallel projection is not perpendicular to the view plane.

Orthographic Parallel Projection

Oblique Parallel Projection The projectors are still ortogonal to the projection plane But the projection plane can have any orientation with respect to the object. It is used extensively in architectural and mechanical design.

Oblique Parallel Projection Preserve parallel lines but not angles Isometric view : Projection plane is placed symmetrically with respect to the three principal faces that meet at a corner of object. Dimetric view : Symmetric with two faces. Trimetric view : General case.

Oblique Parallel Projection Preserve parallel lines but not angles Isometric view : Projection plane is placed symmetrically with respect to the three principal faces that meet at a corner of object. Dimetric view : Symmetric with two faces. Trimetric view : General case.

Perspective Projections First discovered by Donatello, Brunelleschi, and DaVinci during Renaissance Objects closer to viewer look larger Parallel lines appear to converge to single point

Perspective Projections In perspective projection object positions are transformed to the view plane along lines that converge to a point called the projection reference point (or center of projection)

Perspective Projections In the real world, objects exhibit perspective foreshortening: distant objects appear smaller The basic situation:

Perspective Projections When we do 3-D graphics, we think of the screen as a 2-D window onto the 3-D world: How tall should this bunny be?

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

Perspective Projections Desired result for a point [x, y, z, 1]T projected onto the view plane:

View Volumes When a camera used to take a picture, the type of lens used determines how much of the scene is caught on the film. In 3D viewing, a rectangular view window in the view plane is used to the same effect. Edges of the view window are parallel to the xv-yv axes and window boundary positions are specified in viewing coordinates.

View Volumes Parallel Projection Parallel Projection View volume (frustum) window zv Back Plane window Front Plane Back Plane Projection Reference Point Front Plane Parallel Projection Parallel Projection Perspective Projection

Clipping An algorithm for 3D clipping identifies and saves all surface segments within the view volume for display. All parts of object that are outside the view volume are discarded.

Clipping Lines Just like the case in two dimensions, clipping removes objects that will not be visible from the scene The point of this is to remove computational effort 3-D clipping is achieved in two basic steps Discard objects that can’t be viewed i.e. objects that are behind the camera, outside the field of view, or too far away Clip objects that intersect with any clipping plane

Discard Objects Discarding objects that cannot possibly be seen involves comparing an objects bounding box/sphere against the dimensions of the view volume Can be done before or after projection

Clipping Polygon Surface To clip a polygon surface, we can clip the individual polygon edges. First we test the coordinate extends against each boundary of the view volume to determine whether the object is completely inside or completely outside of that boundary. If the object has intersection with the boundary then we apply intersection calculations.

Clipping Polygon Surface The projection operation can take place before the view- volume clipping or after clipping. All objects within the view volume map to the interior of the specified projection window. The last step is to transform the window contents to a 2D view port.

Normalisation The transformed volume is then normalised around position (0, 0, 0) and the z axis is reversed

Dividing Up The World Similar to the case in two dimensions, we divide the world into regions This time we use a 6-bit region code to give us 27 different region codes The bits in these regions codes are as follows: bit 6 Far bit 5 Near bit 4 Top bit 3 Bottom bit 2 Right bit 1 Left

Region Codes

3D Line Clipping Example (cont…) When then simply continue as per the two dimensional line clipping algorithm

Clipping Polygon Surface Viev volume

3D Polygon Clipping (cont…) In this case we first try to eliminate the entire object using its bounding volume Next we perform clipping on the individual polygons using the Sutherland-Hodgman algorithm we studied previously

OpenGL Projection Commands

OpenGL Look-At Function OpenGL utility function VRP: eyePoint (eyex, eyey, eyez) VPN: – ( atPoint – eyePoint ) (atx, aty, atz) – (eyex, eyey, eyez) VUP: upPoint – eyePoint (upx, upy, upz) gluLookAt(eyex, eyey, eyez, atx, aty, atz, upx, upy, upz); look-at positioning

Projections in OpenGL Angle of view, field of view : Only objects that fit within the angle of view of the camera appear in the image View volume, view frustum : Be clipped out of scene Frustum – truncated pyramid