Geometric Transformations

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
Three Dimensional Modeling Transformations
1 Computer Graphics Chapter 6 2D Transformations.
Two-Dimensional Geometric Transformations
CMPE 466 COMPUTER GRAPHICS
HCI 530 : Seminar (HCI) Damian Schofield. HCI 530: Seminar (HCI) Transforms –Two Dimensional –Three Dimensional The Graphics Pipeline.
2D Geometric Transformations
CMPE 466 COMPUTER GRAPHICS
Chapter 4.1 Mathematical Concepts
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry Trigonometric functions Defined using right triangle  x y h.
2D/3D Geometric Transformations CS485/685 Computer Vision Dr. George Bebis.
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
Computer Graphics with OpenGL 3e
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
Mathematical Fundamentals
COS 397 Computer Graphics Svetla Boytcheva AUBG, Spring 2013.
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
Transformation of Graphics
Mathematical Foundations Sections A-1 to A-5 Some of the material in these slides may have been adapted from university of Virginia, MIT and Åbo Akademi.
2D Transformation of Graphics
2003CS Hons RW778 Graphics1 Chapter 5: Transforming Objects 5.2 Introduction to Transformations 5.2 Introduction to Transformations –Affine transformations.
Dx = 2 dy = 3 Y X D Translation A translation is applied to an object by repositioning it along a straight-line path.
2D Geometric Transformations
Part7: Geometric Transformations
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
Transformations Jehee Lee Seoul National University.
CS 325 Introduction to Computer Graphics 02 / 17 / 2010 Instructor: Michael Eckmann.
Geometric Transformations
CS 376 Introduction to Computer Graphics 02 / 16 / 2007 Instructor: Michael Eckmann.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Computer Graphics 2D Transformations. 2 of 74 Contents In today’s lecture we’ll cover the following: –Why transformations –Transformations Translation.
Computer Graphics 3D Transformations. Translation.
Two-Dimensional Geometric Transformations ch5. 참조 Subjects : Basic Transformations Homogeneous Coordinates Composite Transformations Other Transformations.
Two-Dimensional Geometric Transformations A two dimensional transformation is any operation on a point in space (x, y) that maps that point's coordinates.
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
2D Geometric Transformation Translation A translation is applied to an object by repositioning it along a straight-line path from one coordinate location.
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
Geometric Transformations UBI 516 Advanced Computer Graphics Aydın Öztürk
3-D Geometric Transformations
Affine Geometry.
CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
Learning Objectives Affine transformations Affine transformations Translation Translation Rotation Rotation Scaling Scaling Reflection Reflection Shear.
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.
1 Teaching Innovation - Entrepreneurial - Global The Centre for Technology enabled Teaching & Learning, N Y S S, India DTEL DTEL (Department for Technology.
CS 325 Introduction to Computer Graphics 02 / 19 / 2010 Instructor: Michael Eckmann.
Computer Graphics Lecture 11 2D Transformations I Taqdees A. Siddiqi
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Computer Graphic 2 D Transformation.
Transformations. Modeling Transformations  Specify transformations for objects  Allows definitions of objects in own coordinate systems  Allows use.
Forward Projection Pipeline and Transformations CENG 477 Introduction to Computer Graphics.
Chapter 11 Three-Dimensional Geometric and Modeling Transformations
3D Geometric Transformation
3. Transformation
2D Transformations By: KanwarjeetSingh
Computer Graphics CC416 Week 15 3D Graphics.
Computer Graphics Transformations.
Review: Transformations
Computer Graphics Lecture 18 3-D Transformations-II Taqdees A
Computer Graphics 3D Transformations
Computer Graphics Transformations.
Chapter IV Spaces and Transforms
Presentation transcript:

Geometric Transformations CENG 477 Introduction to Computer Graphics Fall 2015-2016 Computer Engineering METU

2D Geometric Transformations

Basic Geometric Transformations Geometric transformations are used to transform the objects and the camera in a scene (for animation or modelling) and are also used to transform World Coordinates to View Coordinates Given the shape, transform all the points of the shape? Transform the points and/or vectors describing it. For example: Polygon: corner points Circle, Ellipse: center point(s), point at angle 0 Some transformations preserves some of the attributes like sizes, angles, ratios of the shape.

Translation Simply move the object to a relative position. P' T P

Rotation A rotation is defined by a rotation axis and a rotation angle. For 2D rotation, the parameters are rotation angle (θ) and the rotation point (xr,yr). We reposition the object in a circular path arround the rotation point (pivot point) θ xr yr

Rotation When (xr,yr)=(0,0) we have r The original coordinates are: P P' The original coordinates are: Substituting them in the first equation we get: In the matrix form we have: where

Rotation Rotation around an arbitrary point (xr,yr) This equations can be written as matrix operations (we will see when we discuss homogeneous coordinates). P' r P (xr,yr)

Scaling Change the size of an object. Input: scaling factors (sx,sy) non-uniform vs. uniform scaling

Homogenous Coordinates All transformations can be represented by matrix operations. Translation is additive, rotation and scaling is multiplicative (+ additive if you rotate around an arbitrary point or scale around a fixed point); making the operations complicated. Adding another dimension to transformations make translation also representable by multiplication. Cartesian coordinates vs homogenous coordinates.

Many points in homogenous coordinates can represent the same point in Cartesian coordinates. In homogenous coordinates, all transformations can be written as matrix multiplications.

Transformations in Homogenous C. Translation Rotation Scaling

Composite Transformations Application of a sequence of transformations to a point:

Composite Transformations First: composition of similar type transformations If we apply to successive translations to a point:

Composite Transformations

Rotation around a pivot point Translate the object so that the pivot point moves to the origin Rotate around origin Translate the object so that the pivot point is back to its original position

Scaling with respect to a fixed point Translate to origin Scale Translate back

Order of matrix compositions Matrix composition is not commutative. So, be careful when applying a sequence of transformations. pivot same pivot

Other Transformations Reflection

Shear: Deform the shape like shifted slices. (2,1) (0,1) (1,1) (3,1)

Transformations Between the Coordinate Systems Between different systems: Polar coordinates to cartesian coordinates Between two cartesian coordinate systems. For example, relative coordinates or window to viewport transformation.

How to transform from x,y to x',y' ? Superimpose x',y' to x,y Transformation: Translate so that (x0,y0) moves to (0,0) of x,y Rotate x' axis onto x axis y y' x' x x y y' x' x x

y Alternate method for rotation: Specify a vector V for positive y' axis: y' x' V x x

Elements of any rotation matrix can be expressed as elements of a set of orthogonal unit vectors:

Let triangle T be defined as three column vectors: Example: y' y M T T x x' Let triangle T be defined as three column vectors:

Affine Transformations Coordinate transformations of the form: Translation, rotation, scaling, reflection, shear. Any affine transformation can be expressed as the combination of these. Rotation, translation, reflection: preserve angles, lengths, parallel lines

3 DIMENSIONAL TRANSFORMATIONS

3D Transformations z x,y,z coordinates. Usual notation: Right handed coordinate system Analogous to 2D we have 4 dimensions in homogenous coordinates. Basic transformations: Translation Rotation Scaling y x y x x z z y

Translation move the object to a relative position. y x z y x z

Rotation Rotation arround the coordinate axes x axis y axis z axis z x Counterclockwise when looking along the positive half towards origin

Rotation around coordinate axes Arround x Arround y Arround z

Rotation Arround a Parallel Axis Rotating the object around a line parallel to one of the axes: Translate to axis, rotate, translate back. y y y y x x x x z z z z Translate Rotate Translate back

Figure from the textbook

Rotation Around an Arbitrary Axis Translate the object so that the rotation axis passes though the origin Rotate the object so that the rotation axis is aligned with one of the coordinate axes Make the specified rotation Reverse the axis rotation Translate back x z

Rotation Around an Arbitrary Axis

Rotation Around an Arbitrary Axis u is the unit vector along V: First step: Translate P1 to origin: Next step: Align u with the z axis we need two rotations: rotate around x axis to get u onto the xz plane, rotate around y axis to get u aligned with z axis.

Rotation Around an Arbitrary Axis Align u with the z axis 1) rotate around x axis to get u into the xz plane, 2) rotate around y axis to get u aligned with the z axis y y y u u u' α α x x x u uz β z z z

Dot product and Cross Product v dot u = vx * ux + vy * uy + vz * uz. That equals also to |v|*|u|*cos(a) if a is the angle between v and u vectors. Dot product is zero if vectors are perpendicular. v x u is a vector that is perpendicular to both vectors you multiply. Its length is |v|*|u|*sin(a), that is an area of parallelogram built on them. If v and u are parallel then the product is the null vector.

Rotation Around an Arbitrary Axis Align u with the z axis 1) rotate around x axis to get u into the xz plane, 2) rotate around y axis to get u aligned with the z axis We need cosine and sine of α for rotation u u' α x uz z Projection of u on yz plane

Rotation Around an Arbitrary Axis Align u with the z axis 1) rotate around x axis to get u into the xz plane, 2) rotate around y axis to get u aligned with the z axis u β x u''= (a,0,d) z

Rotation, ... Alternative Method Any rotation around origin can be represented by 3 orthogonal unit vectors: This matrix can be thought of as rotating the unit r1*, r2*, and r3* vectors onto x, y, and z axes. So, to align a given rotation axis u onto the z axis, we can define an (orthogonal) coordinate system and form this R matrix Define a new coordinate system with the given rotation axis u using:

Rotation, ... Alternative Method Check if this is equal to

Scaling Change the coordinates of the object by scaling factors. y x z

Scaling with respect to a Fixed Point Translate to origin, scale, translate back y x y y y x x x z z z z Translate Scale Translate back

Scaling with respect to a Fixed Point

Reflection Reflection over planes, lines or points y y y y x x x x z z

Shear Deform the shape depending on another dimension