Geometric Transformations. Transformations Linear transformations Rigid transformations Affine transformations Projective transformations T Global reference.

Slides:



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

Computer Graphics: 3D Transformations
1 ME 302 DYNAMICS OF MACHINERY Dynamic Force Analysis IV Dr. Sadettin KAPUCU © 2007 Sadettin Kapucu.
1 Computer Graphics Chapter 6 2D Transformations.
Math 1Hofstra University – CSC171A1 Modeling Objects by Polygonal Approximations Define volumetric objects in terms of surfaces patches that surround the.
2/7/2001Hofstra University – CSC290B1 Review: Math (Ch 4)
CS 4731: Computer Graphics Lecture 7: Introduction to Transforms, 2D transforms Emmanuel Agu.
Modeling Objects by Polygonal Approximations
CS5500 Computer Graphics March 22, Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Coordinate-Free Geometry When we learned simple.
1 CSCE 441 Computer Graphics: 2D Transformations Jinxiang Chai.
Ch. 2: Rigid Body Motions and Homogeneous Transforms
3-D Geometry.
Ch. 3: Forward and Inverse Kinematics
2IV60 Computer Graphics 2D transformations
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.
COS 397 Computer Graphics Svetla Boytcheva AUBG, Spring 2013.
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.
Transformations Dr. Amy Zhang.
Kinematics of Robot Manipulator
OpenGL Matrices and Transformations Angel, Chapter 3 slides from AW, Red Book, etc. CSCI 6360.
TWO DIMENSIONAL GEOMETRIC TRANSFORMATIONS CA 302 Computer Graphics and Visual Programming Aydın Öztürk
Graphics Graphics Korea University kucg.korea.ac.kr Transformations 고려대학교 컴퓨터 그래픽스 연구실.
2D Transformations.
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.
Geometric Transformations Jehee Lee Seoul National University.
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
Transformations Jehee Lee Seoul National University.
Rick Parent - CIS681 ORIENTATION Use Quaternions Interpolating rotations is difficult.
OpenGL Geometric Transformations. glMatrixMode(GL_MODELVIEW);
Geometric Transformations
Geometric Objects and Transformation
1 Computer Graphics Week9 -3D Geometric Transformation.
16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.
Rotation and Orientation: Fundamentals Jehee Lee Seoul National University.
CSE Real Time Rendering Week 5. Slides(Some) Courtesy – E. Angel and D. Shreiner.
Computer Graphics I, Fall 2010 OpenGL Transformations.
3D Transformations. Translation x’ = x + tx y’ = y + ty z’ = z + tz P = P’ = T = P’ = T. P tx ty tz xyz1xyz1 x’ y’ z’ 1 x y.
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 OpenGL Transformations.
Geometric Transformations
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Transformations Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Geometric Transformations Sang Il Park Sejong University Many slides come from Jehee Lee’s.
Attributes of Graphics Primitives
Geometric Transformations UBI 516 Advanced Computer Graphics Aydın Öztürk
Affine Geometry.
CS552: Computer Graphics Lecture 4: 2D Graphics. Recap 2D Graphics Coordinate systems 2D Transformations o Translation o Scaling o Rotation Combining.
1 Representation. 2 Objectives Introduce concepts such as dimension and basis Introduce coordinate systems for representing vectors spaces and frames.
Learning Objectives Affine transformations Affine transformations Translation Translation Rotation Rotation Scaling Scaling Reflection Reflection Shear.
1 OpenGL Transformations. 2 Objectives Learn how to carry out transformations in OpenGL ­Rotation ­Translation ­Scaling Introduce OpenGL matrix modes.
Homogeneous Coordinates and Matrix Representations Cartesian coordinate (x, y, z) Homogeneous coordinate (x h, y h, z h, h) Usually h = 1. But there are.
1 Geometric Transformations-II Modelling Transforms By Dr.Ureerat Suksawatchon.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
1 Geometric Transformations Modelling Transforms By Dr.Ureerat Suksawatchon.
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Image Warping 2D Geometric Transformations
CSCE 441 Computer Graphics: 2D Transformations
Transformations. Transformations Introduce standard transformations ◦ Rotation ◦ Translation ◦ Scaling ◦ Shear Derive homogeneous coordinate transformation.
4. Geometric Objects and Transformations
Modeling Transformation
Objectives Introduce standard transformations Introduce standard transformations Derive homogeneous coordinate transformation matrices Derive homogeneous.
3. Transformation
Review: Transformations
Review: Transformations
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Transformations.
Transformations 고려대학교 컴퓨터 그래픽스 연구실 kucg.korea.ac.kr.
Geometric Objects and Transformations (II)
Transformations 2 University of British Columbia
TWO DIMENSIONAL TRANSFORMATION
Rotation and Orientation: Fundamentals
Presentation transcript:

Geometric Transformations

Transformations Linear transformations Rigid transformations Affine transformations Projective transformations T Global reference frame Local moving frame

Linear Transformations A linear transformation T is a mapping between vector spaces – T maps vectors to vectors –linear combination is invariant under T In 3D-spaces, T can be represented by a 3x3 matrix

Affine Transformations An affine transformation T is an mapping between affine spaces –T maps vectors to vectors, and points to points –T is a linear transformation on vectors –affine combination is invariant under T In 3D-spaces, T can be represented by a 3x3 matrix together with a 3x1 translation vector

Homogeneous Coordinates Any affine transformation between 3D spaces can be represented by a 4x4 matrix Affine transformation is linear in homogeneous coordinates

Projective Spaces Homogeneous coordinates –(x, y, z, w) = (x/w, y/w, z/w, 1) –Useful for handling perspective projection But, it is algebraically inconsistent !!

Examples of Affine Transformations 2D rotation 2D scaling

Examples of Affine Transformations 2D shear 2D reflection

Examples of Affine Transformations 2D translation

Examples of Affine Transformations 2D transformation for vectors –Translation is simply ignored

Examples of Affine Transformations 3D rotation

Pivot-Point Rotation Rotation with respect to a pivot point (x,y)

Fixed-Point Scaling Scaling with respect to a fixed point (x,y)

Scaling Direction Scaling along an arbitrary axis

Properties of Affine Transformations Any affine transformation between 3D spaces can be represented as a combination of a linear transformation followed by translation An affine transf. maps lines to lines An affine transf. maps parallel lines to parallel lines An affine transf. preserves ratios of distance along a line An affine transf. does not preserve absolute distances and angles

Review of Affine Frames A frame is defined as a set of vectors {v i | i=1, …, N } and a point o –Set of vectors {v i } are bases of the associate vector space –o is an origin of the frame –N is the dimension of the affine space –Any point p can be written as –Any vector v can be written as

Changing Frames Affine transformations as a change of frame

Changing Frames Affine transformations as a change of frame

Changing Frames In case the xyz system has standard bases

Rigid Transformations A rigid transformation T is a mapping between affine spaces –T maps vectors to vectors, and points to points –T preserves distances between all points –T preserves cross product for all vectors (to avoid reflection) In 3-spaces, T can be represented as

Rigid Body Rotation Rigid body transformations allow only rotation and translation Rotation matrices form SO(3) –Special orthogonal group (Distance preserving) (No reflection)

Rigid Body Rotation R is normalized –The squares of the elements in any row or column sum to 1 R is orthogonal –The dot product of any pair of rows or any pair columns is 0 The rows (columns) of R correspond to the vectors of the principle axes of the rotated coordinate frame

3D Rotation About Arbitrary Axis

1.Translation : rotation axis passes through the origin 2. Make the rotation axis on the z-axis 3. Do rotation 4. Rotation & translation

3D Rotation About Arbitrary Axis Rotate u onto the z-axis

3D Rotation About Arbitrary Axis Rotate u onto the z-axis –u’: Project u onto the yz-plane to compute angle  –u’’: Rotate u about the x-axis by angle  –Rotate u’’ onto the z-asis

3D Rotation About Arbitrary Axis Rotate u’ about the x-axis onto the z-axis –Let u=(a,b,c) and thus u’=(0,b,c) –Let u z =(0,0,1)

3D Rotation About Arbitrary Axis Rotate u’ about the x-axis onto the z-axis –Since we know both cos  and sin , the rotation matrix can be obtained –Or, we can compute the signed angle  –Do not use acos() since its domain is limited to [-1,1]

Euler angles Arbitrary rotation can be represented by three rotation along x,y,z axis

Gimble Hardware implementation of Euler angles Aircraft, Camera

Euler Angles Rotation about three orthogonal axes –12 combinations XYZ, XYX, XZY, XZX YZX, YZY, YXZ, YXY ZXY, ZXZ, ZYX, ZYZ Gimble lock –Coincidence of inner most and outmost gimbles’ rotation axes –Loss of degree of freedom

Euler Angles Euler angles are ambiguous –Two different Euler angles can represent the same orientation –This ambiguity brings unexpected results of animation where frames are generated by interpolation.

Taxonomy of Transformations Linear transformations –3x3 matrix –Rotation + scaling + shear Rigid transformations –SO(3) for rotation –3D vector for translation Affine transformation –3x3 matrix + 3D vector or 4x4 homogenous matrix –Linear transformation + translation Projective transformation –4x4 matrix –Affine transformation + perspective projection

Taxonomy of Transformations Projective Affine Rigid

Composite Transformations Composite 2D Translation

Composite Transformations Composite 2D Scaling

Composite Transformations Composite 2D Rotation

OpenGL Geometric Transformations glMatrixMode(GL_MODELVIEW);

OpenGL Geometric Transformations Basic Transpormation: –glLoadIdentity(); –glTranslatef(tx, ty, tz); –glRotatef(theta, vx, vy, vz); angle-axis (vx, vy, vz) is automatically normalized –glScalef(sx, sy, sz); –glLoadMatrixf(Glfloat elems[16]); Multiplication –glMultMatrixf(Glfloat elems[16]); –The current matrix is postmultiplied by the matrix –Column major

OpenGL Geometric Transformations Getting the current matrix value: –glGetFloatv (GL_MODELVIEW_MATRIX, GLfloat elems[16]); Column major GLfloat mat [16]; glGetFloatv (GL_MODELVIEW_MATRIX, mat); GLfloat mat [16]; glGetFloatv (GL_MODELVIEW_MATRIX, mat);

OpenGL Geometric Transformations Matrix Direct Manipulation: –glLoadMatrixf(GLfloat elems[16]); Column major –glMultMatrixf(GLfloat elems[16]); The current matrix is postmultiplied by the matrix glLoadIdentity(); glMultMatrixf (M1); glMultMatrixf (M2); glLoadIdentity(); glMultMatrixf (M1); glMultMatrixf (M2); M = M1∙M2

OpenGL GLUT Animation Function GLUT Idle Callback fuction: –Idling: when there is nothing to do. Redraw the scene: glutIdelFunc ( MyIdle ); void MyIdle() { … // things to do … // when Idling } void MyIdle() { … // things to do … // when Idling } glutPostRedisplay ( );

Hierarchical Modeling A hierarchical model is created by nesting the descriptions of subparts into one another to form a tree organization

OpenGL Matrix Stacks Four matrix modes –Modelview, projection, texture, and color –glGetIntegerv(GL_MAX_MODELVIEW_STACK_DEPTH, stackSize); Stack processing –The top of the stack is the “current” matrix –glPushMatrix(); // Duplicate the current matrix at the top –glPopMatrix(); // Remove the matrix at the top