The View Matrix Lecture 21 Fri, Oct 17, 2003. The View Matrix The function gluLookAt() creates a matrix representing the transformation from world coordinates.

Slides:



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

Computer Graphics: 3D Transformations
GR2 Advanced Computer Graphics AGR
1 Unsymmetrical and/or inhomogeneous cross sections | CIE3109 CIE3109 Structural Mechanics 4 Hans Welleman Module : Unsymmetrical and/or inhomogeneous.
The View Frustum and the Camera Lecture 19 Fri, Oct 10, 2003.
CLASS 6 PERSPECTIVE CS770/870. Orthographic projections Isometric ObliqueIn isometric all distances along the major axes are the same.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Viewing/Projections I.
Single-view metrology
Based on slides created by Edward Angel
1 3D modelling with OpenGL Brian Farrimond Robina Hetherington.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Computer Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
2D/3D Geometric Transformations CS485/685 Computer Vision Dr. George Bebis.
Viewing Transformations CS5600 Computer Graphics by Rich Riesenfeld 5 March 2002 Lecture Set 11.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Representation Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
3D Coordinate Systems and Transformations Revision 1
Lecture 15: Single-view modeling CS6670: Computer Vision Noah Snavely.
The Pinhole Camera Model
Representation CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Informationsteknologi Wednesday, November 14, 2007Computer Graphics - Class 81 Today’s class Orthogonal matrices Quaternions Shears Synthetic camera Viewing.
Linear Algebra Review CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2005.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology 3D Engines and Scene Graphs Spring 2012.
CS 450: Computer Graphics 2D TRANSFORMATIONS
Single-view metrology
Whiteboardmaths.com © 2011 All rights reserved
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Course 12 Calibration. 1.Introduction In theoretic discussions, we have assumed: Camera is located at the origin of coordinate system of scene.
Digital Image Processing CCS331
POSITION & ORIENTATION ANALYSIS. This lecture continues the discussion on a body that cannot be treated as a single particle but as a combination of a.
Foundations of Computer Graphics (Fall 2012) CS 184, Lectures 13,14: Reviews Transforms, OpenGL
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 4: Transformations 2
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.
Preserving Normals Lecture 28 Wed, Nov 12, The Effect of a Transformation on a Normal What happens to a normal vector under a linear transformation?
Viewing CS418 Computer Graphics John C. Hart. Graphics Pipeline Homogeneous Divide Model Coords Model Xform World Coords Viewing Xform Still Clip Coords.
Robot Kinematics: Position Analysis 2.1 INTRODUCTION  Forward Kinematics: to determine where the robot ’ s hand is? (If all joint variables are known)
Transformation.
Project 5 Lamp Shader Fri, Nov 7, 2003 Due Mon, Nov 17, 2003.
Graphics CSCI 343, Fall 2015 Lecture 16 Viewing I
October 16, 2014Computer Vision Lecture 12: Image Segmentation II 1 Hough Transform The Hough transform is a very general technique for feature detection.
3-D Geometric Transformations
3D Geometric Transformation
3D Geometric Transformation
Introduction to Computer Graphics: Viewing Transformations Rama C
Taxonomy of Projections FVFHP Figure Taxonomy of Projections.
1 Representation. 2 Objectives Introduce concepts such as dimension and basis Introduce coordinate systems for representing vectors spaces and frames.
CS 4731: Computer Graphics Lecture 12: More 3D Viewing Emmanuel Agu.
Graphics Lecture 2: Slide 1 Lecture 2 Transformations for animation.
Coordinate Systems Lecture 1 Fri, Sep 2, The Coordinate Systems The points we create are transformed through a series of coordinate systems before.
Instructor: Mircea Nicolescu Lecture 9
OpenGL and You I Cast, Therefore I Am. Ray Casting Idea is simple, implementation takes some work –Cast rays as if you were the camera –Determine intersection.
Go Back > Question 1 Describe this transformation. A reflection in the line y = x. ? Object Image.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Shadows & occlusion  Shadow - occlusion duality  Floor shadows.
 A vector is a mathematical object that has both magnitude (size) and direction  Students will be able to use basic vector operations and the dot product.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Computer Viewing Isaac Gang University of Mary Hardin-Baylor.
End effector End effector - the last coordinate system of figure Located in joint N. But usually, we want to specify it in base coordinates. 1.
Vectors – The Cross Product Lecture 13 Wed, Sep 24, 2003.
Coordinate Systems Lecture 20 Wed, Oct 15, Object Coordinates Each object has its own “local” coordinate system, called object coordinates. Normally.
YEAR 11 MATHS REVISION Transformations.
FCC Graficación CAD/CAM 3D Transformations. Contents 1. Translation 2. Scaling 3. Rotation 4. Other Transformations.
Introduction to 3-D Viewing Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, October 27, 2003.
The three basis vectors are mutually perpendicular.
Lecture 10 Geometric Transformations In 3D(Three- Dimensional)
Viewing Viewing and viewing space (camera space)
and an introduction to matrices
3D Transformation Pipeline
FP1 Matrices Transformations
Viewing and Perspective Transformations
Projection in 3-D Glenn G. Chappell
The Modelview Matrix Lecture 8 Mon, Sep 10, 2007.
The View Matrix Lecture 20 Mon, Oct 24, 2005.
Presentation transcript:

The View Matrix Lecture 21 Fri, Oct 17, 2003

The View Matrix The function gluLookAt() creates a matrix representing the transformation from world coordinates to eye coordinates. This is called the view matrix. The model matrix is the one that places the objects in position in world coordinates.

The View Matrix The current transformation is post- multiplied by the matrix created by gluLookAt(). For this reason, gluLookAt() should be called before the model transformations, such as rotating or translating individual objects. Thus, it will affect the entire scene.

The Eye Coordinate System The matrix created by the gluLookAt() function transforms world coordinates system into eye, or camera, coordinates. Let the vectors u, v, n be the unit vectors of the eye coordinate system (corresponding to i, j, k in the world coordinate system).

The Eye Coordinate System Let E be the eye position, L the look point, and up the up vector. E L up

The Eye Coordinate System We will base our calculations on the facts that i  j = k j  k = i k  i = j |i| = |j| = |k| = 1. Therefore, we should end up with u  v = n v  n = u n  u = v |u| = |v| = |n| = 1.

The Eye Coordinate System Form the normalized vector n = (E – L)/|E – L|. E L up n

The Eye Coordinate System The vector u must be perpendicular (and to the right) of n. Define u to be the unit vector u = (up  n)/|up  n|. up E L n u

The Eye Coordinate System We cannot assume that up is perpendicular to n. Therefore, let v be the unit vector v = (n  u)/|n  u| up E L n u v

The View Matrix The coordinate system of the camera is determined by u, v, n. The view matrix V must transform u, v, n into i, j, k. Vu = i Vv = j Vn = k

The View Matrix We know from an earlier discussion that this means that the view matrix will be of the form uxux uyuy uzuz a vxvx vyvy vzvz b nxnx nyny nznz c 0001 V = For some values of a, b, and c.

The View Matrix To determine a, b, and c, use that fact that V also transforms E to the origin: VE = O. Thus, a = –(u x e x + u y e y + u z e z ) = –u  e b = –(v x e x + v y e y + v z e z ) = –v  e c = –(n x e x + n y e y + n z e z ) = –n  e where e = E – O.

The View Matrix Therefore, the matrix created by gluLookAt() is uxux uyuy uzuz –u  e–u  e vxvx vyvy vzvz –v  e–v  e nxnx nyny nznz –n  e–n  e 0001 V =

The View Matrix Verify that V transforms the points E  (0, 0, 0) E + u  (1, 0, 0) E + v  (0, 1, 0) E + n  (0, 0, 1)

Example LookMover.cpp mesh.cpp Remove the call to gluLookAt(). Translate the cone 5 units in the negative z-direction. Reinstate gluLookAt(). Change the up vector.

Example: Modelview Matrix Let eye = (10, 5, 5), look = (0, 5, 0), up = (1, 1, 0). Then eye – look = (10, 0, 5). n = (2, 0, 1)/  5. up  n = (1, -1, -2)/  5. u = (1, -1, -2)/  6. v = n  u = (1, 5, -2)/  30.

Example: Modelview Matrix Also e = eye – O = (10, 5, 5). –e  u = -5/  6. –e  v = 25/  30. –e  n = 25/  5.

Example: Modelview Matrix Therefore, the view matrix is 1/  6-1/  6-2/  6-5/  6 1  305/  30-2/  3025/  30 2/52/50/50/51/51/525/ 