Gopi -ICS280F02 - Slide 1 Model Transformations. Gopi -ICS280F02 - Slide 2 Popular Linear Transformations TranslationTranslation ScalingScaling RotationRotation.

Slides:



Advertisements
Similar presentations
Computer Graphics 2D & 3D Transformation.
Advertisements

COMPUTER GRAPHICS 2D TRANSFORMATIONS.
Computer Graphics Lecture 4 Geometry & Transformations.
Geometric Transformations
1 ME 302 DYNAMICS OF MACHINERY Dynamic Force Analysis IV Dr. Sadettin KAPUCU © 2007 Sadettin Kapucu.
1 Computer Graphics Chapter 6 2D Transformations.
2D TRANSFORMATIONS.
CMPE 466 COMPUTER GRAPHICS
Transformations II Week 2, Wed Jan 17
2-D Geometry. The Image Formation Pipeline Outline Vector, matrix basics 2-D point transformations Translation, scaling, rotation, shear Homogeneous.
1 Geometrical Transformation 2 Outline General Transform 3D Objects Quaternion & 3D Track Ball.
Math for CSTutorial 11 Course Outline Homogeneous Coordinates.
CS 4731: Computer Graphics Lecture 7: Introduction to Transforms, 2D transforms Emmanuel Agu.
Elementary 3D Transformations - a "Graphics Engine" Transformation procedures Transformations of coordinate systems Translation Scaling Rotation.
Graphics-1 Gentle Introduction to Computer Graphics (2) Based on: –David Brogan’s “Introduction to Computer Graphics” Course Slides, University of Virginia.
2.1 si SI31 Advanced Computer Graphics AGR Lecture 2 Basic Modelling.
1 Geometrical Transformation Tong-Yee Lee. 2 Modeling Transform Specify transformation for objects Allow definitions of objects in own coordinate systems.
Math for CSLecture 11 Mathematical Methods for Computer Science Lecture 1.
Math for CSTutorial 11 Matrix Multiplication Rule Matrices make linear transformations of vectors.
Computer Graphics with OpenGL 3e
CS 4731: Computer Graphics Lecture 8: 3D Affine transforms Emmanuel Agu.
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.
2D Transformations Unit - 3. Why Transformations? In graphics, once we have an object described, transformations are used to move that object, scale it.
CAP4730: Computational Structures in Computer Graphics
3D Graphics Goal: To produce 2D images of a mathematically described 3D environment Issues: –Describing the environment: Modeling (mostly later) –Computing.
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.
Mathematical Fundamentals
Lecture Notes: Computer Graphics.
Transformations Jehee Lee Seoul National University.
CS 376 Introduction to Computer Graphics 02 / 16 / 2007 Instructor: Michael Eckmann.
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.
Geometry: 2-D Transformations Course web page: Chapter #3.
1 Computer Graphics Week9 -3D Geometric Transformation.
2D Transformation. Transformation changes an object’s: – Position(Translation) – Size(Scaling) – Orientation(Rotation) – Shape(Deformation) Transformation.
Computer Graphics 3D Transformations. Translation.
Two-Dimensional Geometric Transformations A two dimensional transformation is any operation on a point in space (x, y) that maps that point's coordinates.
Geometric Transformations
Multimedia Programming 07: Image Warping Keyframe Animation Departments of Digital Contents Sang Il Park.
3D Transformation A 3D point (x,y,z) – x,y, and z coordinates
3-D Geometric Transformations
Honours Graphics 2008 Session 2. Today’s focus Vectors, matrices and associated math Transformations and concatenation 3D space.
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.
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.
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
CSCE 441 Computer Graphics: 2D Transformations
Transformations. Transformations Introduce standard transformations ◦ Rotation ◦ Translation ◦ Scaling ◦ Shear Derive homogeneous coordinate transformation.
Modeling Transformation
Robotic Arms and Matrices By Chris Wong and Chris Marino.
Instructor: Dr. Shereen Aly Taie Basic Two-Dimensional Geometric Transformation 5.2 Matrix Representations and Homogeneous Coordinates 5.3 Inverse.
Transformations University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016 Tamara Munzner.
Forward Projection Pipeline and Transformations CENG 477 Introduction to Computer Graphics.
Lecture 10 Geometric Transformations In 3D(Three- Dimensional)
3D Geometric Transformation
Geometric Transformations Hearn & Baker Chapter 5
2D Transformations By: KanwarjeetSingh
Computer Graphics CC416 Week 15 3D Graphics.
Review: Transformations
3D Geometric Transformations
Three-Dimensional Graphics
Transformations 3 University of British Columbia
Three-Dimensional Graphics
Reflections in Coordinate Plane
Geometrical Transformations
CSCE441: Computer Graphics 2D/3D Transformations
Transformations.
TWO DIMENSIONAL TRANSFORMATION
Translation in Homogeneous Coordinates
Presentation transcript:

Gopi -ICS280F02 - Slide 1 Model Transformations

Gopi -ICS280F02 - Slide 2 Popular Linear Transformations TranslationTranslation ScalingScaling RotationRotation ShearShear

Gopi -ICS280F02 - Slide 3 Translation Translation is displacement of a point by a vector.Translation is displacement of a point by a vector. Translation of an object is achieved by displacing every point belonging to that object by the same vector.Translation of an object is achieved by displacing every point belonging to that object by the same vector. A vector cannot be “translated”.A vector cannot be “translated”. Point P: (x,y,z) Vector V:(tx,ty,tz) then Translated Point TP:(x+tx, y+ty, z+tz)Point P: (x,y,z) Vector V:(tx,ty,tz) then Translated Point TP:(x+tx, y+ty, z+tz)

Gopi -ICS280F02 - Slide 4 Using matrix for translation Point P: (x,y,z,1) (Homogeneous representation)Point P: (x,y,z,1) (Homogeneous representation) Translation Vector V: (tx,ty,tz)Translation Vector V: (tx,ty,tz) 100tx 010ty 001tz 0001xy z 1 =x+txy+ty z+tz 1

Gopi -ICS280F02 - Slide 5 Example translation

Gopi -ICS280F02 - Slide 6 Rotation Rotation (in 3D) requires an axis and an angle (r).Rotation (in 3D) requires an axis and an angle (r). The equation changes with the coordinate system (right handed or left handed system)The equation changes with the coordinate system (right handed or left handed system) In graphics, assume right handed system unless otherwise specified. (OpenGL uses right handed system.)In graphics, assume right handed system unless otherwise specified. (OpenGL uses right handed system.)

Gopi -ICS280F02 - Slide 7 Matrix for Rotation about Z r (x,y) (x’,y’) cos(r) -sin(r) 00 sin(r) cos(r) xy z 1 =x’y’ z’ 1 X Y Z axis is pointing out of the screen)

Gopi -ICS280F02 - Slide 8 Matrix for Rotation about X and Y cos(r) 0 sin(r) sin(r) 0 cos(r) xy z 1 =x’y’ z’ sin(r) 0 0 sin(r) cos(r) xy z 1 =x’y’ z’ 1

Gopi -ICS280F02 - Slide 9 Matrix for Scaling (x,y) (s x x,s y y) sxsxsxsx000 0 sysysysy00 00 szszszsz0 0001xy z 1 = sxxsxxsxxsxx syysyysyysyy szzszzszzszz 1 X Y Z axis is pointing out of the screen) =x’y’ z’ 1

Gopi -ICS280F02 - Slide 10 Shear Translation of one coordinate of a point is proportional to the ‘value’ of the other coordinate of the same point.Translation of one coordinate of a point is proportional to the ‘value’ of the other coordinate of the same point. –Point : (x,y) –After ‘y-shear’: (x+ay,y) –After ‘x-shear’: (x,y+bx) Changes the shape of the object.Changes the shape of the object.

Gopi -ICS280F02 - Slide 11 Using matrix for Shear Example: Z-shear (Z coordinate does not change)Example: Z-shear (Z coordinate does not change) 10a0 01b xy z 1 =x+azy+bz z 1 =x’y’ z’ 1

Gopi -ICS280F02 - Slide 12 Composition of Transformations Example: A point P is first translated and then rotated. Translation matrix T, Rotation Matrix R.Example: A point P is first translated and then rotated. Translation matrix T, Rotation Matrix R. –After Translation: P’= TP –After Rotation: P’’=RP’=RTP Example: A point is first rotated and then translated.Example: A point is first rotated and then translated. –After Rotation: P’= RP –After Translation: P’’=TP’=TRP Since matrix multiplication is not commutative,Since matrix multiplication is not commutative, –RTP = TRP

Gopi -ICS280F02 - Slide 13 Composition of Transformations X Y X Y X Y T R X Y X Y X Y T R TRP RTP

Gopi -ICS280F02 - Slide 14 Coordinate Systems You Say: A point P is “first translated” and “then rotated”.You Say: A point P is “first translated” and “then rotated”. You Write: P’ = RTP (write Rotation first, then translation, then the point)You Write: P’ = RTP (write Rotation first, then translation, then the point) Say: “Global Coordinate System”Say: “Global Coordinate System” Write: “Local Coordinate System”Write: “Local Coordinate System” Results of both are same. Interpretation is different.Results of both are same. Interpretation is different.

Gopi -ICS280F02 - Slide 15 Local / Global Coordinate Systems X Y X Y X Y X Y X Y X Y “Local” Y “Local” X “Local” Y “Local” X GCS: You say “point is first translated and then rotated” LCS: You say as you write: “RTP”

Gopi -ICS280F02 - Slide 16 Coordinate Systems OpenGL follows LOCAL COORDINATE SYSTEM glTranslate(…)glRotate(…)glScale(…)DrawModel() Means: TRS.P (You issue transformation commands in the order your write!!)

Gopi -ICS280F02 - Slide 17 End