Three-Dimensional Viewing

Slides:



Advertisements
Similar presentations
Computer Graphics - Viewing -
Advertisements

CS 691 Computational Photography Instructor: Gianfranco Doretto 3D to 2D Projections.
Three Dimensional Viewing
Projection.
Three-Dimensional Viewing Sang Il Park Sejong University Lots of slides are stolen from Jehee Lee’s.
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,
Announcements. Projection Today’s Readings Nalwa 2.1.
Lecture 5: Projection CS6670: Computer Vision Noah Snavely.
Announcements Mailing list Project 1 test the turnin procedure *this week* (make sure it works) vote on best artifacts in next week’s class Project 2 groups.
Lecture 12: Projection CS4670: Computer Vision Noah Snavely “The School of Athens,” Raphael.
Viewing Doug James’ CG Slides, Rich Riesenfeld’s CG Slides, Shirley, Fundamentals of Computer Graphics, Chap 7 Wen-Chieh (Steve) Lin Institute of Multimedia.
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.
1 Chapter 5 Viewing. 2 Perspective Projection 3 Parallel Projection.
Computer Graphics (fall 2009)
UBI 516 Advanced Computer Graphics Three Dimensional Viewing
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
1 E. Angel and D. Shreiner : Interactive Computer Graphics 6E © Addison-Wesley 2012 Classical Viewing Sai-Keung Wong ( 黃世強 ) Computer Science National.
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 고려대학교 컴퓨터 그래픽스 연구실.
OpenGL Geometric Transformations. OpenGL Matrix Stacks Stack processing –The top of the stack is the “current” matrix –glPushMatrix(); // Duplicate the.
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.
Three-Dimensional Viewing Jehee Lee Seoul National University.
CS 325 Introduction to Computer Graphics 02 / 22 / 2010 Instructor: Michael Eckmann.
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 고려대학교 컴퓨터 그래픽스 연구실.
Jinxiang Chai CSCE 441 Computer Graphics 3-D Viewing 0.
Three-Dimensional Viewing Hearn & Baker Chapter 7
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
©2005, Lee Iverson Lee Iverson UBC Dept. of ECE EECE 478 Viewing and Projection.
Graphics CSCI 343, Fall 2015 Lecture 16 Viewing I
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.
CS552: Computer Graphics Lecture 11: Orthographic Projection.
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
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.
Outline 3D Viewing Required readings: HB 10-1 to 10-10
PROJECTIONS PROJECTIONS 1. Transform 3D objects on to a 2D plane using projections 2 types of projections Perspective Parallel In parallel projection,
3 DIMENSIONAL VIEWING Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Chapter 11 Three-Dimensional Geometric and Modeling Transformations
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
Unit 4 3D Viewing Pipeline Part - 2
“Computer Science is no more about computers than astronomy is about telescopes.” Professor Edsger Dijkstra.
Three Dimensional Viewing
OpenGL 2D Viewing Pipeline
Viewing (Projections)
Viewing (Projections)
3D Viewing.
THREE-DIMENSIONAL VIEWING
Presentation transcript:

Three-Dimensional Viewing Sang Il Park Sejong University Lots of slides are stolen from Jehee Lee’s

Viewing Pipeline

Virtual Camera Model Viewing Transformation Projection Transformation The camera position and orientation is determined Projection Transformation The selected view of a 3D scene is projected onto a view plane

General 3D Viewing Pipeline Modeling coordinates (MC) World coordinates (WC) Viewing coordinates (VC) Projection coordinates (PC) Normalized coordinates (NC) Device coordinates (DC)

Viewing-Coordinate Parameters View point (eye point or viewing position) View-plane normal vector N

Viewing-Coordinate Parameters Look-at point Pref View-up vector V N and V are specified in the world coordinates V should be perpendicular to N, but it can be difficult to a direction for V that is precisely perpendicular to N

Viewing-Coordinate Reference Frame The camera orientation is determined by the uvn reference frame u v n

World-to-Viewing Transformation Transformation from world to viewing coordinates Translate the viewing-coordinate origin to the world-coordinate origin Apply rotations to align the u, v, n axes with the world xw, yw, zw axes, respectively u v n

World-to-Viewing Transformation

Perspective Projection Pin-hold camera model Put the optical center (Center Of Projection) at the origin Put the image plane (Projection Plane) in front of the COP The camera looks down the negative z axis we need this if we want right-handed-coordinates This way the image is right-side-up

Parallel Projection Special case of perspective projection Distance from the COP to the PP is infinite Also called “parallel projection” What’s the projection matrix? Image World Slide by Steve Seitz

Taxonomy of Geometric Projections parallel perspective orthographic axonometric oblique trimetric cavalier cabinet dimetric isometric single-point two-point three-point

Orthographic Transformation Preserves relative dimension The center of projection at infinity The direction of projection is parallel to a principle axis Architectural and engineering drawings

Axonometric Transformation Orthogonal projection that displays more than one face of an object Projection plane is not normal to a principal axis, but DOP is perpendicular to the projection plane Isometric, dimetric, trimetric

Oblique Parallel Projections Projection plane is not normal to a principal axis, but DOP is perpendicular to the projection plane Only faces of the object parallel to the projection plane are shown true size and shape

Oblique Parallel Projections www.maptopia.com

Oblique Parallel Projections

Oblique Parallel Projections Typically, f is either 30˚ or 45˚ L1 is the length of the projected side edge Cavalier projections L1 is the same as the original length Cabinet projections L1 is the half of the original length

Oblique Parallel Projections Cavalier projections Cabinet projections

Perspective Projection Pin-hold camera model Put the optical center (Center Of Projection) at the origin Put the image plane (Projection Plane) in front of the COP The camera looks down the negative z axis we need this if we want right-handed-coordinates This way the image is right-side-up

Perspective Projection Projection equations Compute intersection with PP of ray from (x,y,z) to COP Derived using similar triangles (on board) We get the projection by throwing out the last coordinate:

Homogeneous coordinates Is this a linear transformation?

Homogeneous coordinates Trick: add one more coordinate: Converting from homogeneous coordinates homogeneous projection coordinates homogeneous viewing coordinates

Perspective Projection Projection is a matrix multiply using homogeneous coordinates: divide by third coordinate This is known as perspective projection The matrix is the projection matrix Can also formulate as a 4x4 divide by fourth coordinate

Perspective Projection The projection matrix can be much involved, if the COP is different from the origin of the uvn coordinates See the textbook for the detailed matrix

Traditional Classification of Projections Three principle axes of the object is assumed The front, top, and side face of the scene is apparent

Traditional Classification of Projections

Perspective-Projection View Volume Viewing frustum Why do we need near and far clipping plane ?

Normalizing Transformation Transform an arbitrary perspective-projection view volume into the canonical view volume Step 1: from frustum to parallelepiped

Normalizing Transformation Transform an arbitrary perspective-projection view volume into the canonical view volume Step 2: from parallelepiped to normalized

OpenGL 3D Viewing Functions Viewing-transformation function glMatrixMode(GL_MODELVIEW); gluLookAt(x0,y0,z0,xref,yref,zref,vx,vy,vz); Default: gluLookAt(0,0,0, 0,0,-1, 0,1,0); OpenGL orthogonal-projection function glMatrixMode(GL_PROJECTION); gluOrtho(xwmin,xwmax, ywmin,ywmax, dnear,dfar); Default: gluOrtho(-1,1, -1,1, -1,1); Note that dnear and dfar must be assigned positive values znear=-dnear and zfar=-dfar The near clipping plane is the view plane

OpenGL 3D Viewing Functions OpenGL perspective-projection function The projection reference point is the viewing-coordinate origin The near clipping plane is the view plane Symmetric: gluPerspective(theta,aspect,dnear,dfar) General: glFrustum(xwmin,xwmax,ywmin,ywmax,dnear,dfar)

3D Clipping Algorithms Three-dimensional region coding

3D Clipping Algorithms Parametric line clipping

3D Clipping Algorithms Three-dimensional polygon clipping Bounding box or sphere test for early rejection Sutherland-Hodgman and Weiler-Atherton algorithms can be generalized

Programming Assignment #3 (3D Viewer) You are required to implement a 3D OpenGL scene viewer The viewer should use a virtual trackball to rotate the view The point of rotation is by default the center of the world coordinate system, but can be placed anywhere in the scene The viewer should allow you to translate in the screen plane as well as dolly in and out (forward/backward movement) Your are required to submit a report of at most 3 pages Describe how to use your program Describe what you implemented, and what you haven’t

Programming Assignment #3 (3D Viewer) Virtual trackball A trackball translates 2D mouse movements into 3D rotations This is done by projecting the position of the mouse on to an imaginary sphere behind the viewport As the mouse is moved the camera (or scene) is rotated to keep the same point on the sphere underneath the mouse pointer

Programming Assignment #3 (3D Viewer) Virtual trackball

Programming Assignment #3 (3D Viewer) (Graphics Group only) Show all: Decide the camera position and orientation such that the entire scene is viewed in a single screen Zoom in/out: Adjust the field of view Seek: Pick a 3D point in the scene by the mouse pointer and place the center of rotation at that point.