CS 4731: Computer Graphics Lecture 12: More 3D Viewing Emmanuel Agu.

Slides:



Advertisements
Similar presentations
3D Transformations Assist. Prof. Dr. Ahmet Sayar
Advertisements

Computer Graphics: 3D Transformations
Computer Graphics - Viewing -
SI23 Introduction to Computer Graphics
The View Frustum and the Camera Lecture 19 Fri, Oct 10, 2003.
Viewing and Camera Rotations CSE 781 Prof. Roger Crawfis.
Based on slides created by Edward Angel
CS 4731: Computer Graphics Lecture 7: Introduction to Transforms, 2D transforms Emmanuel Agu.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Computer Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
3-D Geometry.
Computer Graphics (Fall 2008) COMS 4160, Lecture 4: Transformations 2
OpenGL (II). How to Draw a 3-D object on Screen?
CS 4731: Computer Graphics Lecture 11: 3D Viewing Emmanuel Agu.
2D Transformations x y x y x y. 2D Transformation Given a 2D object, transformation is to change the object’s Position (translation) Size (scaling) Orientation.
Computer Graphics 3D Transformations. 3D Translation Remembering 2D transformations -> 3x3 matrices, take a wild guess what happens to 3D transformations.
CS 4731: Computer Graphics Lecture 9: Introduction to 3D Modeling Emmanuel Agu.
Introduction to 3D viewing 3D is just like taking a photograph!
2003CS Hons RW778 Graphics1 Chapter 5: Transforming Objects 5.2 Introduction to Transformations 5.2 Introduction to Transformations –Affine transformations.
Geometric transformations The Pipeline
CS559: Computer Graphics Lecture 9: Projection Li Zhang Spring 2008.
Viewing Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 5.
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 4: Transformations 2
Exam Review Questions. Problem: A cube has vertices with world coordinates: (1, 0, 0) (2, 0, 0) (1, 1, 0) (2, 1, 0) (1, 0, 1) (2, 0, 1) (1, 1, 1) (2,
Transformations of Objects – 3D
Stages of Vertex Transformation To specify viewing, modeling, and projection transformations, you construct a 4 × 4 matrix M, which is then multiplied.
Computer Graphics I, Fall 2010 Computer Viewing.
Angel: Interactive Computer Graphics CSE 409: Computer Graphics Camera Transformations and Projection Acknowledgements: parts of information and pictures.
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.
Geometric Transformations
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.
©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,
3D Transformation A 3D point (x,y,z) – x,y, and z coordinates
Classical Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Introduction to Computer Graphics: Viewing Transformations Rama C
Taxonomy of Projections FVFHP Figure Taxonomy of Projections.
Chap 3 Viewing and Transformation
Honours Graphics 2008 Session 3. Today’s focus Perspective and orthogonal projection Quaternions Graphics camera.
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
1 Dr. Scott Schaefer 3D Transformations. 2/149 Review – Vector Operations Dot Product.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Viewing Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Computer Viewing Isaac Gang University of Mary Hardin-Baylor.
Building a Camera in a Program Need: To have fine control over camera movements we create and manipulate our own camera in a program Steps: 1.Create Camera.
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
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.
CSCE 441 Computer Graphics: 2D Transformations
What you will learn about today
Viewing Viewing and viewing space (camera space)
Computer Graphics CC416 Week 14 3D Graphics.
Viewing.
Computer Viewing.
Review: Transformations
Isaac Gang University of Mary Hardin-Baylor
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.
3D Transformation Pipeline
Projection v VP u VPN n.
Computer Graphics : Viewing in 3D_4
Viewing Transformations
Three-Dimensional viewing
What you will learn about today
University of New Mexico
Projection v VP u VPN n.
The View Matrix Lecture 20 Mon, Oct 24, 2005.
Viewing Transformations II
Presentation transcript:

CS 4731: Computer Graphics Lecture 12: More 3D Viewing Emmanuel Agu

3D viewing under the hood Modeling Viewing Projection Transformation Transformation Transformation Viewport Transformation Display

3D viewing under the hood Topics of Interest: Viewing transformation Projection transformation

Viewing Transformation Transform the object from world to eye space Construct eye coordinate frame Construct matrix to perform coordinate transformation Flexible Camera Control

Viewing Transformation Recall OpenGL way to set camera: gluLookAt (Ex, Ey, Ez, cx, cy, cz, Up_x, Up_y, Up_z) The view up vector is usually (0,1,0) Remember to set the OpenGL matrix mode to GL_MODELVIEW first Modelview matrix: combination of modeling matrix M and Camera transforms V gluLookAt fills V part of modelview matrix What does gluLookAt do with parameters (eye, COI, up vector) you provide?

Eye Coordinate Frame Known: eye position, center of interest, view-up vector To find out: new origin and three basis vectors eye center of interest (COI) Assumption: direction of view is orthogonal to view plane (plane that objects will be projected onto) 90 o

Eye Coordinate Frame Origin: eye position (that was easy) Three basis vectors: one is the normal vector (n) of the viewing plane, other two (u and v) span the viewing plane eye Center of interest (COI) n u v world origin Remember u,v,n should be all unit vectors n is pointing away from the world because we use left hand coordinate system N = eye – COI n = N / | N | (u,v,n should all be orthogonal)

Eye Coordinate Frame How about u and v? eye COI n u v V_up We can get u first - u is a vector that is perp to the plane spanned by N and view up vector (V_up) U = V_up x n u = U / | U |

Eye Coordinate Frame How about v? eye COI n u v V_up Knowing n and u, getting v is easy v = n x u v is already normalized

Eye Coordinate Frame Put it all together eye COI n u v V_up Eye space origin: (Eye.x, Eye.y, Eye.z) Basis vectors: n = (eye – COI) / | eye – COI| u = (V_up x n) / | V_up x n | v = n x u

World to Eye Transformation Transformation matrix (M w2e ) ? P’ = M w2e x P u v n world x y z P 1. Come up with the transformation sequence to move eye coordinate frame to the world 2. And then apply this sequence to the point P in a reverse order

World to Eye Transformation Rotate the eye frame to “align” it with the world frame Translate (-ex, -ey, -ez) u v n world x y z (ex,ey,ez) Rotation: ux uy uz 0 vx vy vz 0 nx ny nz Translation: ex ey ez

World to Eye Transformation Transformation order: apply the transformation to the object in a reverse order - translation first, and then rotate M w2e = u v n world x y z (ex,ey,ez) ux uy ux ex vx vy vz ey nx ny nz ez

World to Eye Transformation Head tilt: Rotate your head by  Just rotate the object about the eye space z axis -  M w2e = cos(- -sin(- 0 0 ux uy ux ex sin(- cos(- 0 0 vx vy vz ey nx ny nz ez u v n world x y z Why - ? When you rotate your head by , it is like rotate the object by –