Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.

Slides:



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

Computer Graphics: 3D Transformations
COMPUTER GRAPHICS 2D TRANSFORMATIONS.
Computer Graphics Lecture 4 Geometry & Transformations.
Geometric Transformations
Arbitrary Rotations in 3D Lecture 18 Wed, Oct 8, 2003.
Transformations II Week 2, Wed Jan 17
CMPE 466 COMPUTER GRAPHICS
Linear Algebra and SVD (Some slides adapted from Octavia Camps)
CS 4731: Computer Graphics Lecture 7: Introduction to Transforms, 2D transforms Emmanuel Agu.
1 CSCE 441 Computer Graphics: 2D Transformations Jinxiang Chai.
2.1 si SI31 Advanced Computer Graphics AGR Lecture 2 Basic Modelling.
3-D Geometry.
CSCE 689: Computer Animation Rotation Representation and Interpolation
CS 4731: Computer Graphics Lecture 8: 3D Affine transforms Emmanuel Agu.
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.
CS 450: Computer Graphics 2D TRANSFORMATIONS
Mathematical Fundamentals
COS 397 Computer Graphics Svetla Boytcheva AUBG, Spring 2013.
Transformations Aaron Bloomfield CS 445: Introduction to Graphics
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.
2D Transformations.
Geometric Transformations Jehee Lee Seoul National University.
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
CS 376 Introduction to Computer Graphics 02 / 16 / 2007 Instructor: Michael Eckmann.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Jinxiang Chai Composite Transformations and Forward Kinematics 0.
1 Computer Graphics Week9 -3D Geometric Transformation.
Introduction to Computer Graphics Geometric Transformations
Computer Graphics 3D Transformations. Translation.
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.
Geometric Transformations
Affine Transformation. Affine Transformations In this lecture, we will continue with the discussion of the remaining affine transformations and composite.
Transformations CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
Geometric Transformations Sang Il Park Sejong University Many slides come from Jehee Lee’s.
3D Transformation A 3D point (x,y,z) – x,y, and z coordinates
COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS D Geometric Transformations Graphics Systems.
January 19, y X Z Translations Objects are usually defined relative to their own coordinate system. We can translate points in space to new positions.
3-D Geometric Transformations
3-D Transformational Geometry CS418 Computer Graphics John C. Hart.
Lecture 5: Introduction to 3D
Affine Geometry.
CS552: Computer Graphics Lecture 4: 2D Graphics. Recap 2D Graphics Coordinate systems 2D Transformations o Translation o Scaling o Rotation Combining.
3D Coordinate Systems o3D computer graphics involves the additional dimension of depth, allowing more realistic representations of 3D objects in the real.
Learning Objectives Affine transformations Affine transformations Translation Translation Rotation Rotation Scaling Scaling Reflection Reflection Shear.
Composite 3D Transformations. Example of Composite 3D Transformations Try to transform the line segments P 1 P 2 and P 1 P 3 from their start position.
1 By Dr. HANY ELSALAMONY.  We have seen how to create models in the 3D world. We discussed transforms in lecture 3, and we have used some transformations.
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.
Geometric Transformations. Transformations Linear transformations Rigid transformations Affine transformations Projective transformations T Global reference.
CS 325 Introduction to Computer Graphics 02 / 19 / 2010 Instructor: Michael Eckmann.
Computer Graphics Lecture 16 Fasih ur Rehman. Last Class Homogeneous transformations Types of Transformations – Linear Transformations – Affine Transformations.
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
CSCE 441 Computer Graphics: 2D Transformations
3D Geometry and Transformations
Transformations. Transformations Introduce standard transformations ◦ Rotation ◦ Translation ◦ Scaling ◦ Shear Derive homogeneous coordinate transformation.
Modeling Transformation
Forward Projection Pipeline and Transformations CENG 477 Introduction to Computer Graphics.
Modeling Transformations
2D Geometric Transformations
Computer Graphics CC416 Week 15 3D Graphics.
Review: Transformations
Review: Transformations
2D Transformations y y x x y x.
Computer Graphics Transformations
Three-Dimensional Graphics
Three-Dimensional Graphics
CSCE441: Computer Graphics 2D/3D Transformations
CS1550 Fundamentals For Computer Graphics Transformations-2
Presentation transcript:

Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0

Review: Translation & Rotation & Scaling Translation: Rotation: Scaling: x’ 1 0 tx x y’ = 0 1 ty * y x’ cos(  ) -sin(  ) 0 x y’ sin(  ) cos(  ) 0 * y = x’ Sx 0 0 x y’ = 0 Sy 0 * y

Review: Shearing and Reflection Shearing Reflection x 1 h 0 x y = * y x x y = * y e.g., reflection about x axis e.g., shearing in x

Review : Affine Transformations Translation, rotation, scaling, and shearing are a special form of general affine transformations

4 Review: Arbitrary Rotation Center (px,py) x’ 1 0 px cos(  ) -sin(  ) px x y’ = 0 1 py sin(  ) cos(  ) py y M1 M1 M2 M2 M3 M3 M= M 3 *M 2 *M 1

Review: More Trans. Composition Arbitrary scaling pivot Reflection about any arbitrary line

How can we extend translation, rotation and scaling into 3D space?

3D Transformation A 3D point (x,y,z) – x,y, and z coordinates We will still use column vectors to represent points. Homogeneous coordinates of a 3D point (x,y,z,1) Transformation will be performed using 4x4 matrix 7

Right-handed Coordinate System Left hand coordinate system Not used in this class and Not in OpenGL 8/94

3D Transformation Very similar to 2D transformation Translation transformation Homogenous coordinates 9

3D Transformation Very similar to 2D transformation Scaling transformation Homogenous coordinates 10

3D Transformation 3D rotation is done around a rotation axis Fundamental rotations – rotate about x, y, or z axes Counter-clockwise rotation is referred to as positive rotation (when you look down negative axis) x y z + 11

3D Transformation Rotation about z – similar to 2D rotation x y z + 12 Keep z constant!

3D Transformation Rotation about y: z -> y, y -> x, x->z y z x x y z 13

3D Transformation Rotation about x (z -> x, y -> z, x->y) x y z z x y 14

Inverse of 3D Transformations Invert the transformation matrix In general, X= AX’-->X’=A -1 X T(t x,t y,t z ) T(-t x,-t y,-t z )

3D Rotation about Arbitrary Axes Rotate p about the by the angle 16

3-D Rotation General rotations in 3-D require rotating about an arbitrary axis of rotation Deriving the rotation matrix for such a rotation directly is a good exercise in linear algebra The general rotation matrix is a combination of coordinate-axis rotations and translations! 17

3D Rotation about Arbitrary Axes Rotate p about the by the angle 18

3-D Rotation General rotations in 3-D require rotating about an arbitrary axis of rotation Deriving the rotation matrix for such a rotation directly is a good exercise in linear algebra Standard approach: express general rotation as composition of canonical rotations  Rotations about x, y, z 19

Composing Canonical Rotations Goal: rotate about arbitrary vector r by θ  Idea: we know how to rotate about x,y,z  Set up a transformation that superimposes rotation axis onto one coordinate axis  Rotate about the coordinate axis  Translate and rotate object back via inverse of the transformation matrix 20

Composing Canonical Rotations Goal: rotate about arbitrary vector r by θ  Idea: we know how to rotate about x,y,z  So, rotate about z by -  until r lies in the xz plane  Then rotate about y by -β until r coincides with +z  Then rotate about z by θ  Then reverse the rotation about y (by β )  Then reverse the rotation about z (by  ) 21

3D Rotation about Arbitrary Axes Rotate p about the by the angle 22

3D Rotation about Arbitrary Axes Translate so that rotation axis passes through the origin 23

3D Rotation about Arbitrary Axes Rotation by about z-axis to place the rotation vector on xoz plane 24

3D Rotation about Arbitrary Axes Rotation by about y-axis to align the rotation vector with z axis 25

3D Rotation about Arbitrary Axes Rotation by about z-axis (rotation vector) 26

3D Rotation about Arbitrary Axes Rotation by about y-axis 27

3D Rotation about Arbitrary Axes Rotation by about z-axis 28

3D Rotation about Arbitrary Axes Translate the object back to original point 29

3D Rotation about Arbitrary Axes Final transformation matrix for rotating about an arbitrary axis 30

3D Rotation about Arbitrary Axes Final transformation matrix for rotating about an arbitrary axis 31

3D Rotation about Arbitrary Axes Final transformation matrix for rotating about an arbitrary axis

3D Rotation about Arbitrary Axes Final transformation matrix for rotating about an arbitrary axis A 3 by 3 Rotation matrix—orthogonal matrix

Rotation Matrices Orthonormal matrix:  orthogonal (columns/rows linearly independent)  normalized (columns/rows length of 1) 34

Rotation Matrices Orthonormal matrix:  orthogonal (columns/rows linearly independent)  normalized (columns/rows length of 1) The inverse of an orthogonal matrix is just its transpose: 35

Rotation Matrices Orthonormal matrix:  orthogonal (columns/rows linearly independent)  normalized (columns/rows length of 1) The inverse of an orthogonal matrix is just its transpose: 36

Rotation Matrices Orthonormal matrix:  orthogonal (columns/rows linearly independent)  normalized (columns/rows length of 1) The inverse of an orthogonal matrix is just its transpose: 37

Why? Rotation Matrices 38 is a 3-by-3 identity matrix

Why? Rotation Matrices 39 is a 3-by-3 identity matrix

Why? Rotation Matrices 40 is a 3-by-3 identity matrix

Why? Rotation Matrices 41 is a 3-by-3 identity matrix

Rotation Matrices Orthonormal matrix:  orthogonal (columns/rows linearly independent)  normalized (columns/rows length of 1) The inverse of an orthogonal matrix is just its transpose: e.g., 42

OpenGL Geometric Transformations Transformation in 3D glTranslate* (tx, ty, tz); glRotate* (theta, vx, vy, vz) glScale* (sx,sy,sz)

OpenGL Geometric Transformations Transformation in 3D e.g., glTranslatef (25.0, -15.0, 0); glRotatef (90.0, 0.0, 0.0, 1.0) glScalef (2.0,-3.0,1.0)

45 Next Lecture 2D coordinate transformations 3D coordinate transformations Lots of vector and matrix operations!