Chi-Cheng Lin, Winona State University CS430 Computer Graphics 3D Viewing and Projections.

Slides:



Advertisements
Similar presentations
Computer Graphics - Viewing -
Advertisements

Three Dimensional Viewing
Projection.
1 View Shandong University Software College Instructor: Zhou Yuanfeng
Three-Dimensional Viewing Sang Il Park Sejong University Lots of slides are stolen from Jehee Lee’s.
1 Projection. 2 Model Transform Viewing Transform Modelview Matrix world coordinates Pipeline Review Focus of this lecture.
Based on slides created by Edward Angel
Viewing and Projections
Classical Viewing CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
OpenGL (II). How to Draw a 3-D object on Screen?
1 Chapter 5 Viewing. 2 Perspective Projection 3 Parallel Projection.
Modeling and Viewing Modeling
Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)
Projection Projection - the transformation of points from a coordinate system in n dimensions to a coordinate system in m dimensions where m
UBI 516 Advanced Computer Graphics Three Dimensional Viewing
Advanced Computer Graphics Three Dimensional Viewing
Computer Graphics I, Fall 2010 Classical Viewing.
CS559: Computer Graphics Lecture 9: Projection Li Zhang Spring 2008.
Viewing Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
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 고려대학교 컴퓨터 그래픽스 연구실.
Computer Graphics Bing-Yu Chen National Taiwan University.
Fundamentals of Computer Graphics Part 5 Viewing prof.ing.Václav Skala, CSc. University of West Bohemia Plzeň, Czech Republic ©2002 Prepared with Angel,E.:
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.
Angel: Interactive Computer Graphics CSE 409: Computer Graphics Camera Transformations and Projection Acknowledgements: parts of information and pictures.
CS 325 Introduction to Computer Graphics 02 / 22 / 2010 Instructor: Michael Eckmann.
Basic Projections 2D to 3D
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 3D Viewing I CIS 736 Computer Graphics Review of Basics 2 of 5: 3D Viewing.
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
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 고려대학교 컴퓨터 그래픽스 연구실.
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.
CS552: Computer Graphics Lecture 11: Orthographic Projection.
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
CS 376 Introduction to Computer Graphics 02 / 21 / 2007 Instructor: Michael Eckmann.
RAC/RA Projection Types of Projection Simple Projections Generalized Projection.
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
Viewing. Classical Viewing Viewing requires three basic elements - One or more objects - A viewer with a projection surface - Projectors that go from.
Projection. Conceptual model of 3D viewing process.
Computer Graphics Projections.
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,
CS552: Computer Graphics Lecture 9: Perspective Projection.
Viewing 고려대학교 컴퓨터 그래픽스 연구실 kucg.korea.ac.kr.
Three Dimensional Viewing
Rendering Pipeline Fall, 2015.
Computer Graphics CC416 Week 14 3D Graphics.
University of North Carolina at Greensboro
Projection Our 3-D scenes are all specified in 3-D world coordinates
3D Viewing cgvr.korea.ac.kr.
Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics
CSCE 441 Computer Graphics 3-D Viewing
Viewing in 3D Chapter 6.
Unit 4 3D Viewing Pipeline Part - 2
Three Dimensional Viewing
OpenGL 2D Viewing Pipeline
Three-Dimensional viewing
3D Graphics.
Viewing (Projections)
Viewing (Projections)
Presentation transcript:

Chi-Cheng Lin, Winona State University CS430 Computer Graphics 3D Viewing and Projections

2 Topics l Synthetic Camera l Steps in 3D Viewing l Projections l Perspective Projections l Parallel Projections l Specification of an Arbitrary 3D View l Graphics Pipeline Revisited

3 Synthetic Camera l Metaphor for creating 3D scenes: l Coordinate system: zCamera: u, v, n zObject: x, y, z

4 Steps in 3D Viewing l Projection type specification zWhy projection? yObjects 3D, device 2D zTwo most important yPerspective yParallel orthographic l Viewing parameter specification zViewing plane zViewing (eye) coordinate system zScene coordinate system

5 Steps in 3D Viewing l 3D clipping zClip against view volume l Projection and display zWindow to viewport transformation l Conceptual model of 3D viewing process

6 Projections l Projection zTransformation from n-D coordinate system to m-D coordinate system, where m < n l Our concern zn = 3 and m = 2  projection from 3D to 2D l Terminology zProjectors: Straight projection rays zCenter of projection: Where the projectors emanated from zProjection plane: Where the projection forms

7 Projections l Projection from 3D to 2D defined by zProjectors emanate from COP, pass though each point of the object, and intersect the projection plane l Planar geometric projections zProjection is onto a plane zReferred to as "projections" here

8 Projections l Two Basic Classes zPerspective zParallel l Perspective zDistance between projection plane and COP is finite zVisual effect similar to human visual system yPerspective foreshortening: distance from COP longer, size smaller zExact shape, measurement, parallelism not reserved

9 Projections l Parallel zDistance between projection plane and COP is infinite zLess realistic view yNo foreshortening zExact measurement and parallelism preserved PerspectiveParallel

10 Perspective Projections l Vanishing Point zPoint that set of parallel lines not parallel to the projection plane converge to zProjection of a point at infinity l Axis Vanishing Point zVanishing point of set of lines parallel to one of three principle axes zAt most 3: yx-axis vanishing point yy-axis vanishing point yz-axis vanishing point

11 Perspective Projections l Example: zIf projection plane cuts only z-axis yOnly z-axis vanishing point yAs lines parallel to x or y axis also parallel to projection plane l Number of Axis Vanishing Points zCan be used to categorize perspective projections zEqual to number of axes cut by projection plane

12 Number of Axis Vanishing Points l One-point l Three-point: hardly used

13 Number of Axis Vanishing Points l Two-point zCommonly used in architecture, engineering, industrial design, and advertising drawings

14 Parallel Projections l Two types, defined by zDirection of projection (DOP) zViewing (projection) plane normal (VPN) l Orthographic zDOP and VPN the same (or the reverse) l Obliuqe zDOP of VPN not the same (nor the reverse)

15 Orthographic Parallel Projections l Projection plane perpendicular to a principle axis l Most common types zFront-elevation zTop-elevation (plane-elevation) zSide-elevation l Used in engineering drawing (such as machine parts) l Hard to deduce 3D nature

16 Orthographic Parallel Projections

17 Orthographic Parallel Projections l Axonometric orthographic projections zProjection plane not normal to a principle axis zSeveral faces of an object can be shown at once zParallalism reserved, distances can be measured zExample: Isometric projection yVPN = DOP = (dx, dy, dz), where |dx| = |dy| = |dz| y8 directions

18 Obliuqe Parallel Projections l Projection plane normal and DOP differ l Projection plane is normal to a principle axis l Measurement of distance and angle of faces parallel to the plane allowed l Widely used (easy to draw) l Cavalier zDOP makes 45 degree with projection plane l Cabinet zDOP makes angle of arctan(2) with projection plane

19 Obliuqe Parallel Projections l CavalierCabinet /2

20 Classification of Planar Geometric Projections

21 Specification of an Arbitrary 3D View l View Plane zProjection Plane zDefined by yVRP (View Reference Point) –look at point in OpenGL yVPN (View Plane Normal) –(eye - look) in OpenGL

22 Specification of an Arbitrary 3D View l Window zSimilar to the window in 2D zContents mapped to the viewport zProjection on the view plane outside the window not shown zSpecification needs the following yMinimum and maximum window coordinates yTwo orthogonal axes zCan be defined by view volume

23 Specification of an Arbitrary 3D View l PRP (Projection Reference Point) zParallel: DOP = from PRP to CW zPerspective: COP z“Eye” in OpenGL l View volume zClipping and projection zPerspective ySemi-infinite pyramid with apex at PRP and edges passing through window corners zParallel yInfinite parallelepiped with sides parallel to DOP

24 Specification of an Arbitrary 3D View l View volume (cont’d) zFinite view volume yFront clipping plane –Parallel to VRP –Specified by F (front distance) = distance(FCP - VRP) yBack clipping plane –Parallel to VRP –Specified by B (back distance) = distance(BCP - VRP) yIn OpenGL, “near” and “far” represents “front” and “back”, respectively, in the camera coordinate

25 Finite View Volumes Perspective Parallel

26 Specification of an Arbitrary 3D View l Mapping from view volume to 2D display zView volume --> NPC (Normalized Projection Coordinates), i.e., standard cube z3D viewport specified in NPC zz=1 face of NPC cube mapped to display zIf wire-frame, z coordinate discarded zIf surface, hidden-surface removal

27 Graphics Pipeline Revisited l Perspective projection VMP clip VpVp modelview matrix projection matrix viewport matrix perspective division screen coordinates normalized device coordinates clip coordinates VMP clip VpVp modelview matrix projection matrix viewport matrix perspective division screen coordinates normalized device coordinates clip coordinates eye coordinates

28 Perspective Viewing with OpenGL l Perspectival transformation l Camera for perspective projection zglMatrixMode(GL_PROJECTION); glLoadIdentity(); glPerspective(viewAngle, aspectRatio, N, F) zExample: glPerspective(60.0, 1.5, 0.3, 50.0) zNear plane serves as the view plane eye y z

29 Perspective Viewing with OpenGL  y z x eye N F N F y 

30 Perspective Viewing with OpenGL l Positioning and aiming camera zglMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(eye.x, eye.y, eye.z, // eye position look.x, look.y, look.z, // look at point up.x, up.y, up.z) // up vector zUp vector is often set to (0, 1, 0)

31 Transformation Matrix for LookAt l Camera coordinate system zAxes: u, v, n n = eye – look u = up  n v = n  u zOrigin: eye (looking in the direction –n) zIf up = (0, 1, 0) then u = (n z, 0, -n x ) i.e., horizontal v = (-n x n y, n x 2 +n z 2, -n z n y ) i.e., more or less upward

32

33 Transformation Matrix for LookAt l Transformation matrix l Verify that V transformed zeye to (0, 0, 0, 1) zu to i = (1, 0, 0, 0) zv to j = (0, 1, 0, 0) zn to k = (0, 0, 1, 0)

34

35