Taxonomy of Projections FVFHP Figure 6.10. Taxonomy of Projections.

Slides:



Advertisements
Similar presentations
Computer Graphics - Viewing -
Advertisements

Three Dimensional Viewing
Based on slides created by Edward Angel
Viewing and Transformation
Viewing and Projections
CS 352: Computer Graphics Chapter 5: Viewing. Interactive Computer GraphicsChapter Overview Specifying the viewpoint Specifying the projection Types.
Viewing Doug James’ CG Slides, Rich Riesenfeld’s CG Slides, Shirley, Fundamentals of Computer Graphics, Chap 7 Wen-Chieh (Steve) Lin Institute of Multimedia.
Transformations and Projections (Some slides adapted from Amitabh Varshney)
OpenGL (II). How to Draw a 3-D object on Screen?
CS 4731: Computer Graphics Lecture 11: 3D Viewing Emmanuel Agu.
Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)
Introduction to 3D viewing 3D is just like taking a photograph!
Transformations Aaron Bloomfield CS 445: Introduction to Graphics
Viewing and Projections
UBI 516 Advanced Computer Graphics Three Dimensional Viewing
Advanced Computer Graphics Three Dimensional Viewing
The Viewing Pipeline (Chapter 4) 5/26/ Overview OpenGL viewing pipeline: OpenGL viewing pipeline: – Modelview matrix – Projection matrix Parallel.
Transformation & Projection Feng Yu Proseminar Computer Graphics :
Geometric transformations The Pipeline
CS559: Computer Graphics Lecture 9: Projection Li Zhang Spring 2008.
Viewing Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
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.
CAP4730: Computational Structures in Computer Graphics 3D Transformations.
Angel: Interactive Computer Graphics CSE 409: Computer Graphics Camera Transformations and Projection Acknowledgements: parts of information and pictures.
CS 450: COMPUTER GRAPHICS PROJECTIONS SPRING 2015 DR. MICHAEL J. REALE.
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.
OpenGL Viewing and Modeling Transformation Geb Thomas Adapted from the OpenGL Programming Guidethe OpenGL Programming Guide.
University of North Carolina at Greensboro
CS 445 / 645 Introduction to Computer Graphics Lecture 10 Camera Models Lecture 10 Camera Models.
Graphics Graphics Korea University kucg.korea.ac.kr Viewing 고려대학교 컴퓨터 그래픽스 연구실.
Jinxiang Chai CSCE 441 Computer Graphics 3-D Viewing 0.
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.
Chapters 5 2 March Classical & Computer Viewing Same elements –objects –viewer –projectors –projection plane.
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.
Projections Angel: Interactive Computer Graphics.
Transformations: Projection CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
Chap 3 Viewing and Transformation
A Photograph of two papers
Viewing and Projection
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Viewing and Projection. The topics Interior parameters Projection type Field of view Clipping Frustum… Exterior parameters Camera position Camera orientation.
CS 551 / 645: Introductory Computer Graphics Viewing Transforms.
Viewing Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
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.
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,
A Photograph of two papers The Model: 2 papers – 8cm x 8cm and 5cm x 5cm The Camera – Simple pinhole – No focusing capability The Scene – Arrangements.
Rendering Pipeline Fall, 2015.
3D Viewing cgvr.korea.ac.kr.
Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics
CSCE 441 Computer Graphics 3-D Viewing
Modeling 101 For the moment assume that all geometry consists of points, lines and faces Line: A segment between two endpoints Face: A planar area bounded.
CENG 477 Introduction to Computer Graphics
A Photograph of two papers
Three Dimensional Viewing
Computer Graphics (Spring 2003)
Perspective Transformation
Last Time Canonical view pipeline Projection Local Coordinate Space
3D Graphics.
Viewing (Projections)
Viewing (Projections)
Presentation transcript:

Taxonomy of Projections FVFHP Figure 6.10

Taxonomy of Projections

Parallel Projection Angel Figure 5.4 Center of projection is at infinity Direction of projection (DOP) same for all pointsDirection of projection (DOP) same for all points Center of projection is at infinity Direction of projection (DOP) same for all pointsDirection of projection (DOP) same for all points DOP View Plane

Orthographic Projections Angel Figure 5.5 TopSide Front DOP perpendicular to view plane

Oblique Projections H&B DOP not perpendicular to view plane Cavalier (DOP  = 45 o ) tan(  ) = 1 Cabinet (DOP  = 63.4 o ) tan(  ) = 2

Oblique Parallel-Projection Oblique View VolumeTransformed View Volume

Oblique Parallel-Projection Oblique View VolumeTransformed View Volume

Transformation Matrix VpVp HB Matrix 7-13

Orthographic Projection Simple Orthographic Transformation Original world units are preserved Pixel units are preferredPixel units are preferred Simple Orthographic Transformation Original world units are preserved Pixel units are preferredPixel units are preferred

Orthographic: Screen Space Transformation top=20 m bottom=10 m left =10 mright = 20 m (0, 0) (max pix x, max pix y ) (width in pixels) (height in pixels)

Orthographic: Screen Space Transformation (Normalization) left, right, top, bottom refer to the viewing frustum in modeling coordinates width and height are in pixel units This matrix scales and translates to accomplish the transition in units left, right, top, bottom refer to the viewing frustum in modeling coordinates width and height are in pixel units This matrix scales and translates to accomplish the transition in units HB Matrix: 7-7

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

Perspective Projection Angel Figure Point Perspective 2-Point Perspective 1-Point Perspective How many vanishing points?

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

Perspective Projection 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 Projection The geometry of the situation is that of similar triangles. View from above: What is x’ ? The geometry of the situation is that of similar triangles. View from above: What is x’ ? d P (x, y, z)X Z View plane (0,0,0) x’ = ?

Perspective Projection Desired result for a point [x, y, z, 1] T projected onto the view plane: What could a matrix look like to do this? Desired result for a point [x, y, z, 1] T projected onto the view plane: What could a matrix look like to do this?

A Perspective Projection Matrix Answer:Answer:

Example: Or, in 3-D coordinates: Example:

Projection Matrices Now that we can express perspective foreshortening as a matrix, we can compose it onto our other matrices with the usual matrix multiplication End result: a single matrix encapsulating modeling, viewing, and projection transforms Now that we can express perspective foreshortening as a matrix, we can compose it onto our other matrices with the usual matrix multiplication End result: a single matrix encapsulating modeling, viewing, and projection transforms

Perspective vs. Parallel Perspective projection +Size varies inversely with distance - looks realistic –Distance and angles are not (in general) preserved –Parallel lines do not (in general) remain parallel Parallel projection +Good for exact measurements +Parallel lines remain parallel –Angles are not (in general) preserved –Less realistic looking Perspective projection +Size varies inversely with distance - looks realistic –Distance and angles are not (in general) preserved –Parallel lines do not (in general) remain parallel Parallel projection +Good for exact measurements +Parallel lines remain parallel –Angles are not (in general) preserved –Less realistic looking

Classical Projections Angel Figure 5.3

Viewing in OpenGL OpenGL has multiple matrix stacks - transformation functions right- multiply the top of the stack Two most important stacks: GL_MODELVIEW and GL_PROJECTION Points get multiplied by the modelview matrix first, and then the projection matrix GL_MODELVIEW : Object->Camera GL_PROJECTION : Camera->Screen glViewport(0,0,w,h): Screen->Device OpenGL has multiple matrix stacks - transformation functions right- multiply the top of the stack Two most important stacks: GL_MODELVIEW and GL_PROJECTION Points get multiplied by the modelview matrix first, and then the projection matrix GL_MODELVIEW : Object->Camera GL_PROJECTION : Camera->Screen glViewport(0,0,w,h): Screen->Device

OpenGL Example void SetUpViewing() { // The viewport isn’t a matrix, it’s just state... glViewport( 0, 0, window_width, window_height ); // Set up camera->screen transformation first glMatrixMode( GL_PROJECTION ); glLoadIdentity(); gluPerspective( 60, 1, 1, 1000 ); // fov, aspect, near, far // Set up the model->camera transformation glMatrixMode( GL_MODELVIEW ); gluLookAt( 3, 3, 2, // eye point 0, 0, 0, // look at point 0, 0, 1 ); // up vector glRotatef( theta, 0, 0, 1 ); // rotate the model glScalef( zoom, zoom, zoom ); // scale the model }

A 3D Scene Notice the presence of the camera, the projection plane, and the world coordinate axes Viewing transformations define how to acquire the image on the projection plane Notice the presence of the camera, the projection plane, and the world coordinate axes Viewing transformations define how to acquire the image on the projection plane

Viewing Transformations Create a camera-centered view Camera is at origin Camera is looking along negative z-axis Camera’s ‘up’ is aligned with y-axis Create a camera-centered view Camera is at origin Camera is looking along negative z-axis Camera’s ‘up’ is aligned with y-axis

2 Basic Steps Align the two coordinate frames by rotation

2 Basic Steps Translate to align origins

Creating Camera Coordinate Space Specify a point where the camera is located in world space, the eye point Specify a point in world space that we wish to become the center of view, the lookat point Specify a vector in world space that we wish to point up in camera image, the up vector Intuitive camera movement Specify a point where the camera is located in world space, the eye point Specify a point in world space that we wish to become the center of view, the lookat point Specify a vector in world space that we wish to point up in camera image, the up vector Intuitive camera movement

Constructing Viewing Transformation, V Create a vector from eye-point to lookat-point Normalize the vector Desired rotation matrix should map this vector to [0, 0, -1] T Why? Create a vector from eye-point to lookat-point Normalize the vector Desired rotation matrix should map this vector to [0, 0, -1] T Why?

Constructing Viewing Transformation, V Construct another important vector from the cross product of the lookat-vector and the vup- vector This vector, when normalized, should align with [1, 0, 0] T Why? Construct another important vector from the cross product of the lookat-vector and the vup- vector This vector, when normalized, should align with [1, 0, 0] T Why?

Constructing Viewing Transformation, V One more vector to define… This vector, when normalized, should align with [0, 1, 0] T Now let’s compose the results One more vector to define… This vector, when normalized, should align with [0, 1, 0] T Now let’s compose the results

Compositing Vectors to Form V We know the three world axis vectors (x, y, z) We know the three camera axis vectors (r, u, l) Viewing transformation, V, must convert from world to camera coordinate systems We know the three world axis vectors (x, y, z) We know the three camera axis vectors (r, u, l) Viewing transformation, V, must convert from world to camera coordinate systems

Compositing Vectors to Form V Remember Each camera axis vector is unit length.Each camera axis vector is unit length. Each camera axis vector is perpendicular to othersEach camera axis vector is perpendicular to others Camera matrix is orthogonal and normalized OrthonormalOrthonormal Therefore, M -1 = M T Remember Each camera axis vector is unit length.Each camera axis vector is unit length. Each camera axis vector is perpendicular to othersEach camera axis vector is perpendicular to others Camera matrix is orthogonal and normalized OrthonormalOrthonormal Therefore, M -1 = M T

Compositing Vectors to Form V Therefore, rotation component of viewing transformation is just transpose of computed vectors

Compositing Vectors to Form V Translation component too Multiply it through Translation component too Multiply it through

Final Viewing Transformation, V To transform vertices, use this matrix: And you get this: To transform vertices, use this matrix: And you get this: