Homogeneous Coordinates They work, but where do they come from? Jonathan Senning

Slides:



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

Computer Graphics: 3D Transformations
1Computer Graphics Homogeneous Coordinates & Transformations Lecture 11/12 John Shearer Culture Lab – space 2
6.4 Best Approximation; Least Squares
Mapping: Scaling Rotation Translation Warp
Camera Models A camera is a mapping between the 3D world and a 2D image The principal camera of interest is central projection.
HCI 530 : Seminar (HCI) Damian Schofield. HCI 530: Seminar (HCI) Transforms –Two Dimensional –Three Dimensional The Graphics Pipeline.
CS5500 Computer Graphics March 22, Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Coordinate-Free Geometry When we learned simple.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Representation Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
Ch. 4: Velocity Kinematics
3-D Geometry.
COMP322/S2000/L221 Relationship between part, camera, and robot (cont’d) the inverse perspective transformation which is dependent on the focal length.
Computer Graphics (Fall 2008) COMS 4160, Lecture 3: Transformations 1
Transformations. 2 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Coordinate-Free Geometry When we learned simple geometry, most of us.
Representation CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Vectors.
3D Graphics Goal: To produce 2D images of a mathematically described 3D environment Issues: –Describing the environment: Modeling (mostly later) –Computing.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology 3D Engines and Scene Graphs Spring 2012.
Geometric Objects and Transformations Geometric Entities Representation vs. Reference System Geometric ADT (Abstract Data Types)
Mathematical Fundamentals
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
COS 397 Computer Graphics Svetla Boytcheva AUBG, Spring 2013.
Transformations Aaron Bloomfield CS 445: Introduction to Graphics
CS 480/680 Computer Graphics Representation Dr. Frederick C Harris, Jr. Fall 2012.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Transformation of Graphics
Transformations Dr. Amy Zhang.
Homogeneous Coordinates (Projective Space) Let be a point in Euclidean space Change to homogeneous coordinates: Defined up to scale: Can go back to non-homogeneous.
Intro to 3D Models Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Transformations Jehee Lee Seoul National University.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Jinxiang Chai Composite Transformations and Forward Kinematics 0.
Geometric Objects and Transformation
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 52 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 52 Computer Graphics Three-Dimensional Graphics I.
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Affine Transformations.
Computer Graphics 3D Transformations. Translation.
Geometric Transformations
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
3D Transformation A 3D point (x,y,z) – x,y, and z coordinates
Geometric Transformations UBI 516 Advanced Computer Graphics Aydın Öztürk
Affine Geometry.
1 Representation. 2 Objectives Introduce concepts such as dimension and basis Introduce coordinate systems for representing vectors spaces and frames.
Digital Image Processing Additional Material : Imaging Geometry 11 September 2006 Digital Image Processing Additional Material : Imaging Geometry 11 September.
III- 1 III 3D Transformation Homogeneous Coordinates The three dimensional point (x, y, z) is represented by the homogeneous coordinate (x, y, z, 1) In.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Computer Graphics I, Fall 2010 Transformations.
4. Affine transformations. Reading Required:  Watt, Section 1.1. Further reading:  Foley, et al, Chapter  David F. Rogers and J. Alan Adams,
Graphics Graphics Korea University kucg.korea.ac.kr Mathematics for Computer Graphics 고려대학교 컴퓨터 그래픽스 연구실.
Projective geometry ECE 847: Digital Image Processing Stan Birchfield Clemson University.
Objectives Introduce standard transformations Introduce standard transformations Derive homogeneous coordinate transformation matrices Derive homogeneous.
Forward Projection Pipeline and Transformations CENG 477 Introduction to Computer Graphics.
Geometric Transformations
Spatcial Description & Transformation
Coordinate Change.
Computer Graphics CC416 Week 15 3D Graphics.
Computer Graphics 3D Transformations
Projective geometry ECE 847: Digital Image Processing Stan Birchfield
Representation Ed Angel Professor Emeritus of Computer Science,
Homogeneous Coordinates (Projective Space)
Isaac Gang University of Mary Hardin-Baylor
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Transformations.
Isaac Gang University of Mary Hardin-Baylor
3D Transformation CS380: Computer Graphics Sung-Eui Yoon (윤성의)
Geometric Objects and Transformations (II)
Representation Ed Angel Professor Emeritus of Computer Science,
CSCE441: Computer Graphics 2D/3D Transformations
Representation Ed Angel
Translation in Homogeneous Coordinates
Presentation transcript:

Homogeneous Coordinates They work, but where do they come from? Jonathan Senning

Outline  Two-dimensional computer graphics  Translation – necessary but nonlinear  Homogeneous coordinates  Affine geometry and spaces  Frames  Homogeneous coordinates again  Perspective projections

Two-dimensional computer graphics  Provides an interesting motivational example  Illustrates linear transformations  Early exposure to idea of isomorphisms  Three key operations: scaling rotation translation

Scaling To scale the x coordinate by α and the y coordinate by β we can use the scaling matrix defined by Applying the transformation scales the vector

Rotation The matrix that implements a counterclockwise rotation about the origin by the angle θ is Applying this gives

Shearing Shearing can also be easily implemented with a matrix Notice that x is increased by a factor of y; shearing, like rotation, is relative to the origin

Translation Unfortunately translation cannot be implemented with matrix-vector multiplication. Here comes the magic...

Homogeneous Coordinates This magic is called “homogeneous coordinates” and (from a student's perspective) consists of appending a 1 to the x and y coordinates.

Homogeneous Coordinates The magic of homogeneous coordinates is twofold: 1. The matrices of existing linear transformations can easily be extended to work with homogeneous coordinates

Homogeneous Coordinates 2. Translation can be implemented as matrix-vector multiplication Little justification is offered for where homogeneous coordinates come from; the justification is usually “they just work.”

Affine Spaces Definition: An affine space consists of a vector space V and a set of points P such that 1. the difference of any two points from P is a vector in V, 2. given any point p from P and vector v from V, the sum p + v is a point in P.

Affine Spaces Suppose p and q are points from P. Then 1. α(p – q) is a vector in V, and 2. q + α(p – q) is a point in P that lies along the line between q and p. q p q + α(p – q)

Affine Combinations This last expression, q + α(p – q), yields a point according to the axioms for affine spaces. If we formally rearrange this we can obtain αp + (1 – α)q or αp + βq where α + β = 1. This is defined to be an affine combination; an affine combination of points yields a point.

Frames A frame for an affine space A=(V,P) is analogous to a basis for a vector space. A frame consists of two things: - a basis B for the vector space V and - a point o from P. Every vector in V is a linear combination of vectors in B. Every point in P can be obtained by adding a vector from V to o.

Frames  A frame for an affine space with an n-dimensional vector space contains n+1 elements.  A frame allows us to locate and orient an n- dimensional vector space relative to another n- dimensional vector space.

Coordinate Axiom To make use of a frame for an affine space we need one additional axiom. The coordinate axiom is quite simple and states: For every point p in an affine space A - 0p is defined to be the zero vector 0 in A, and - 1p is defined to be the point p.

Frames and the Coordinate Axiom Suppose the frame for an affine space A is given by a basis for V and a point o from P. Because of the coordinate axiom, any vector v in A can be written as for suitable choice of constants.

Frames and the Coordinate Axiom Similarly, any point p in A can be written as for suitable. Once a frame is defined, we can describe coordinates of elements in an affine space relative to the frame. As in the case of bases for vector spaces, we assume that elements of the frame are ordered and we require that the point o appears last.

Frame Coordinate Vectors The coordinate vectors of the vector v and the point p are Notice that the coordinate vector of a vector ends with 0 while the coordinate vector of a point ends with 1.

Homogeneous Coordinates Again The frame coordinate vectors are exactly the same as the homogeneous coordinates we've already seen! An interesting project at this point would be to have students derive the transformation matrices for scaling, rotation, and translation by finding suitable frames and the corresponding change-of-frames matrices.

Another View of Homogeneous Coordinates The set of vectors given by can be viewed as points on a plane parallel to the xy-plane but translated away from the origin by 1 unit along the z axis. We can extend the definition of homogeneous coordinates so that is equivalent to all vectors when x = x'/z' and y = y'/z'.

Another View of Homogeneous Coordinates This means that homogeneous coordinates define an surjection of onto an n-dimensional subspace of. Most computer graphics hardware implements the nonlinear scaling operation that normalizes the last coordinate as part of the pipeline that all points pass through. This is called perspective division. From now on we'll be using 3-dimensions...

Perspective Projection Cross section of perspective projection: xy-plane eye at z = 0 viewing plane at z = d object at (x,y,z) image at (x',y',d) field of view z- axis

Perspective Projection From similar triangles we know y'/y = z/d which gives y' = y/(z/d). Repeating these steps we can also find x' = x/(z/d). z y y' d

Perspective Projection We need to perform the mapping This nonlinear operation can (almost) be done with a single matrix-vector multiplication.

Perspective Projection Consider the following operation If perspective division is automatically performed by the graphics system, we obtain the desired vector for the image point.

Summary  Frames provide a useful tool for modern computer graphics.  Students easily pick up these concepts once they are comfortable with vector spaces and bases.  Homogeneous coordinates arise naturally when affine spaces and frames are used, combating the “they just work” rationale for their use.  Homogeneous coordinates make other important operations easy to implement in a modern graphics system.