University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology 3D Engines and Scene Graphs Spring 2012.

Slides:



Advertisements
Similar presentations
Computer Graphics: 3D Transformations
Advertisements

Geometric Transformations
1 Computer Graphics Chapter 6 2D Transformations.
HCI 530 : Seminar (HCI) Damian Schofield. HCI 530: Seminar (HCI) Transforms –Two Dimensional –Three Dimensional The Graphics Pipeline.
1 Geometrical Transformation 2 Outline General Transform 3D Objects Quaternion & 3D Track Ball.
2D Geometric Transformations
Image Warping : Computational Photography Alexei Efros, CMU, Fall 2006 Some slides from Steve Seitz
CS 376 Introduction to Computer Graphics 02 / 09 / 2007 Instructor: Michael Eckmann.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Representation Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
3-D Geometry.
1 Geometrical Transformation Tong-Yee Lee. 2 Modeling Transform Specify transformation for objects Allow definitions of objects in own coordinate systems.
©College of Computer and Information Science, Northeastern UniversityJune 26, CS U540 Computer Graphics Prof. Harriet Fell Spring 2009 Lecture 11.
Representation CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
CS 450: Computer Graphics 2D TRANSFORMATIONS
UNIT - 5 3D transformation and viewing. 3D Point  We will consider points as column vectors. Thus, a typical point with coordinates (x, y, z) is represented.
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 2: Review of Basic Math
Mathematical Fundamentals
COS 397 Computer Graphics Svetla Boytcheva AUBG, Spring 2013.
Transformations Aaron Bloomfield CS 445: Introduction to Graphics
Overview of 3D Computer Graphics
CS 480/680 Computer Graphics Representation Dr. Frederick C Harris, Jr. Fall 2012.
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
CS 480/680 Computer Graphics Transformations Dr. Frederick C Harris, Jr.
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
Transformations Jehee Lee Seoul National University.
Geometric Transformations
©College of Computer and Information Science, Northeastern University CS 4300 Computer Graphics Prof. Harriet Fell Fall 2012 Lecture 12 – October 1, 2012.
Chap. 6 Linear Transformations
Matrices A matrix is a table or array of numbers arranged in rows and columns The order of a matrix is given by stating its dimensions. This is known as.
Computer Graphics, KKU. Lecture 51 Transformations Given two frames in an affine space of dimension n, we can find a ( n+1 ) x ( n +1) matrix that.
Geometric Objects and Transformation
16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Affine Transformations.
Computer Graphics 3D Transformations. Translation.
1 Graphics CSCI 343, Fall 2015 Lecture 10 Coordinate Transformations.
Direct3D Workshop November 17, 2005 Workshop by Geoff Cagle Presented by Players 2 Professionals.
Geometric Transformations
Transformations CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
Computer Graphics, KKU. Lecture 41 The Computer Programming Laws Any given program, when running, is obsolete. Any given program costs more and.
3D Transformation A 3D point (x,y,z) – x,y, and z coordinates
Geometric Transformations UBI 516 Advanced Computer Graphics Aydın Öztürk
3-D Geometric Transformations
3D Geometric Transformation
Affine Geometry.
1 Representation. 2 Objectives Introduce concepts such as dimension and basis Introduce coordinate systems for representing vectors spaces and frames.
II-1 Transformations Transformations are needed to: –Position objects defined relative to the origin –Build scenes based on hierarchies –Project objects.
Instructor: Mircea Nicolescu Lecture 9
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.
CS 325 Introduction to Computer Graphics 02 / 19 / 2010 Instructor: Michael Eckmann.
4. Affine transformations. Reading Required:  Watt, Section 1.1. Further reading:  Foley, et al, Chapter  David F. Rogers and J. Alan Adams,
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
3D Geometry and Transformations
Modeling Transformation
Transformations. Modeling Transformations  Specify transformations for objects  Allows definitions of objects in own coordinate systems  Allows use.
Transformations University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016 Tamara Munzner.
CSE 167 [Win 17], Lecture 2: Review of Basic Math Ravi Ramamoorthi
Lecture 10 Geometric Transformations In 3D(Three- Dimensional)
Geometric Transformations
3D Geometric Transformation
Computer Graphics CC416 Week 15 3D Graphics.
Computer Graphics 3D Transformations
3D Geometric Transformations
Review: Transformations
COMP 175: Computer Graphics February 9, 2016
2D Geometric Transformations
Transformations.
Transformations 2 University of British Columbia
Game Programming Algorithms and Techniques
Presentation transcript:

University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology 3D Engines and Scene Graphs Spring 2012

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 2 Representation We can represent a point, p = (x,y), in the plane as a column vector as a row vector

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 3 Representation, cont. We can represent a 2-D transformation M by a matrix If p is a column vector, M goes on the left: If p is a row vector, M T goes on the right: We will use column vectors.

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 4 Two-dimensional transformations Here's all you get with a 2 x 2 transformation matrix M: So: We will develop some intimacy with the elements a, b, c, d…

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 5 Identity Suppose we choose a=d=1, b=c=0: Gives the identity matrix: Doesn't move the points at all

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 6 Scaling Suppose b=c=0, but let a and d take on any positive value: Gives a scaling matrix: Provides differential (non-uniform) scaling in x and y:

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 7 Reflection Suppose b=c=0, but let either a or d go negative. Examples:

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 8 Shear Now leave a=d=1 and experiment with b The matrix gives:

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 9 Effect on unit square Let's see how a general 2 x 2 transformation M affects the unit square:

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 10 Effect on unit square, cont. Observe: Origin invariant under M M can be determined just by knowing how the corners (1,0) and (0,1) are mapped a and d give x- and y-scaling b and c give x- and y-shearing

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 11 Rotation From our observations of the effect on the unit square, it should be easy to write down a matrix for “ rotation about the origin ” : Thus

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 12 Linear transformations The unit square observations also tell us the 2x2 matrix transformation implies that we are representing a point in a new coordinate system: where u=[a c] T and v=[b d] T are vectors that define a new basis for a linear space. The transformation to this new basis (a.k.a., change of basis) is a linear transformation.

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 13 Limitations of the 2 x 2 matrix A 2 x 2 linear transformation matrix allows Scaling Rotation Reflection Shearing Q: What important operation does that leave out?

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 14 Affine transformations In order to incorporate the idea that both the basis and the origin can change, we augment the linear space u, v with an origin t. Note that while u and v are basis vectors, the origin t is a point. We call u, v, and t (basis and origin) a frame for an affine space. Then, we can represent a change of frame as: This change of frame is also known as an affine transformation. How do we write an affine transformation with matrices?

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 15 Homogeneous Coordinates To represent transformations among affine frames, we can loft the problem up into 3-space, adding a third component to every point: Note that [a c 0] T and [b d 0] T represent vectors and [t x t y 1] T, [x y 1] T and [x' y' 1] T represent points.

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 16 Homogeneous coordinates This allows us to perform translation as well as the linear transformations as a matrix operation:

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 17 Rotation about arbitrary points 1.Translate q to origin 2.Rotate 3.Translate back Line up the matrices for these step in right to left order and multiply. Note: Transformation order is important!! Until now, we have only considered rotation about the origin. With homogeneous coordinates, you can specify a rotation, R q, about any point q = [q x q y 1] T with a matrix:

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 18 Basic 3-D transformations: scaling Some of the 3-D transformations are just like the 2-D ones. For example, scaling:

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 19 Translation in 3D

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 20 Rotation in 3D Rotation now has more possibilities in 3D: Use right hand rule

University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 21 Shearing in 3D Shearing is also more complicated. Here is one example: We call this a shear with respect to the x-z plane.