Part7: Geometric Transformations

Slides:



Advertisements
Similar presentations
COMPUTER GRAPHICS 2D TRANSFORMATIONS.
Advertisements

Arbitrary Rotations in 3D Lecture 18 Wed, Oct 8, 2003.
Three Dimensional Modeling Transformations
1 Computer Graphics Chapter 6 2D Transformations.
Chapter 5 Geometric Transformations
25 May May May 2015Week 5-2D Transformations1 2D Transformations By: KanwarjeetSingh.
2D TRANSFORMATIONS.
CS 4731: Computer Graphics Lecture 7: Introduction to Transforms, 2D transforms Emmanuel Agu.
CS 376 Introduction to Computer Graphics 02 / 09 / 2007 Instructor: Michael Eckmann.
1 CSCE 441 Computer Graphics: 2D Transformations Jinxiang Chai.
2D/3D Geometric Transformations CS485/685 Computer Vision Dr. George Bebis.
Transformations CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Computer Graphics with OpenGL 3e
Larry F. Hodges (modified by Amos Johnson) 1 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
2D Transformations. World Coordinates Translate Rotate Scale Viewport Transforms Hierarchical Model Transforms Putting it all together.
CS 450: Computer Graphics 2D TRANSFORMATIONS
1 Computer Graphics Week7 -2D Rotation. 3-Rotation A shape can be rotated about any of the three axes. A rotation about the z-axis will actually rotate.
2.2 Linear Transformations in Geometry For an animation of this topic visit
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
Geometric Transformations Jehee Lee Seoul National University.
Dx = 2 dy = 3 Y X D Translation A translation is applied to an object by repositioning it along a straight-line path.
 2D Transformations 2D Transformations  Translation Translation  Rotation Rotation  Scaling Scaling.
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
Computer Graphics 2D Transformations. 2 of 74 Contents In today’s lecture we’ll cover the following: –Why transformations –Transformations Translation.
Perform Congruence Transformations. A __________________ is an operation that moves or changes a geometric figure to produce a new figure called an __________.
Transformation.
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.
Geometric Transformations
GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi.
Lecture 3 Transformations. 2D Object Transformations The functions used for modifying the size, location, and orientation of objects or of the camera.
Translations Translations maintain Same Size Same Shape
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.
Geometric Transformations UBI 516 Advanced Computer Graphics Aydın Öztürk
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
3D Geometric Transformation
3D Geometric Transformation
Affine Geometry.
II-1 Transformations Transformations are needed to: –Position objects defined relative to the origin –Build scenes based on hierarchies –Project objects.
Learning Objectives Affine transformations Affine transformations Translation Translation Rotation Rotation Scaling Scaling Reflection Reflection Shear.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Computer Graphics I, Fall 2010 Transformations.
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.
2D Transformations What is transformations? The geometrical changes of an object from a current state to modified state. Why the transformations is needed?
Computer Graphic 2 D Transformation.
CSCE 441 Computer Graphics: 2D Transformations
Transformations. Transformations Introduce standard transformations ◦ Rotation ◦ Translation ◦ Scaling ◦ Shear Derive homogeneous coordinate transformation.
Transformations. Modeling Transformations  Specify transformations for objects  Allows definitions of objects in own coordinate systems  Allows use.
Instructor: Dr. Shereen Aly Taie Basic Two-Dimensional Geometric Transformation 5.2 Matrix Representations and Homogeneous Coordinates 5.3 Inverse.
Forward Projection Pipeline and Transformations CENG 477 Introduction to Computer Graphics.
Lecture 5 Basic geometric objects
Transforms.
3D Geometric Transformation
2D Transformations By: KanwarjeetSingh
Computer Graphics CC416 Week 15 3D Graphics.
3D Transformation.
2D Transformations y y x x y x.
2D/3D Transformations User Interfaces.
Translation in Homogeneous Coordinates
Presentation transcript:

Part7: Geometric Transformations Computer Graphics Part7: Geometric Transformations

April 23, 2017 2D Transformations Transformation means changes in orientation, size, and shape. The basic geometric transformations are translation, rotation, and scaling. Other transformations that are often applied to objects include reflection and shear ( جز).

Transformations Translation Rotation Scaling moving things April 23, 2017 Transformations Translation moving things Rotation moving about a point by a given angle rotation point may be origin or some other chosen point Scaling changing size relative to origin or some other chosen point

2D Translation Repositioning an object along a straight line path from one co-ordinate location to another (x,y) (x’,y’) To translate a 2D position, we add translation distances tx and ty to the original coordinates (x,y) to obtain the new coordinate position (x’,y’) x’= x + tx , y’= y + ty T x y Matrix form

April 23, 2017 2D TRANSLATION Example: Let P = (5, 9), T = (tx, ty) = ( 6, 8) , so P' = (11, 17) Note: To translate a line translate its endpoints. To translate polygon ( مضلع) translate its vertices. Circle or Ellipse: Translate boundary points.

2D Translation Moving a polygon from position (a) to position (b) with the translation vector (-5, 10), i.e. x y 5 10 15 20 x y 5 10 15 20 (a) (b)

April 23, 2017 2D TRANSLATION We think of a point as a column vector, written as a column of numbers between parentheses. We add vectors by adding corresponding coordinates.

2D Rotation Repositioning an object along a circular path in the xy-plane x y (x,y) (x’,y’) φ θ r The original coordinates are:

2D Rotation Substituting x y (x,y) (x’,y’) φ θ r Matrix form

2D Rotation Example Cos 90 = 0 Sin 90 = 1 Rotate the line endpoints (1,2) and ( 4,3) about origin by 90 degree. p(1,2) >>>>> p’(-2,1) x’=1*cos 90 – 2*sin 90 = -2 y’=1*sin 90 + 2*cos 90= 1 P(4,3) >>>>>>> p’(-3,4) x’=4*cos 90 – 3*sin 90= -3 y’=4*sin 90 + 3*cos 90= 4 Cos 90 = 0 Sin 90 = 1

2D Rotation about a Pivot position Rotating about pivot position (xr, yr) x y (x,y) (x’,y’) φ θ r xr yr

Example Rotate the line endpoints (2,1) about point (3,3) by 90 x’=3+(2-3) cos 90 – (1-3) sin 90 x’=3—2=5 y’=3+(2-3) sin 90 + (3-1) cos 90 = 3-1=2

2D Scaling Altering the size of an object. Sx and Sy are the scaling factors. If Sx = Sy then uniform scaling. Sx and Sy can be any positive value. – Values < 1 reduces the size of the object. – Values > 1 produces and enlargement. – If Sx and Sy is 1, then the size is unchanged. Matrix form

2D Scaling relative to Fixed point Scaling relative to fixed point (xf, yf) x y Sx = ¼ , Sy = ½ P1 P2 P3 P1’ P2’ P3’ (xf , yf)

Matrix Representation Use 3×3 matrices to combine transformations Translation Rotation Scaling

Inverse Transformations Translation Rotation Scaling

Example Consider the line with endpoints (10, 10) and (30, 25). Translate it by tx = -20, ty = -10 and then rotate it by θ = 90º. x y (10, 10) (30, 25)

Result x y x y x y T(-20, -10) R(90º) (30, 25) (-15, 10) (10, 10) (0, -10) (-15, 10) x y (10, 15) (-10, 0) x y (0, -10) (-15, 10) T(-20, -10) R(90º)

Exercises Consider the following object: Apply a rotation by 145º then scale it by Sx=2 and Sy=1.5 and then translate it by tx=20 and ty=-30. Scale it by Sx=½ and Sy=2 and then rotate it by 30º. Apply a rotation by 90º and then another rotation by 45º. Apply a rotation by 135º. x y 10 25 45

Exercises Consider the following object: Apply a rotation by 60° on the Pivot Point (-10, 10) and display it. Apply a rotation by 30° on the Pivot Point (45, 10) and display it. Apply a rotation by 270° on the Pivot Point (10, 0) and then translate it by tx = -20 and ty = 5. Display the final result. x y 10 25 45

Exercises Consider the following object: Scale it by sx = 2 and sy = ½ relative to the fixed point (140, 125) and display it. Apply a rotation by 90° on the Pivot Point (50, 60) and then scale it by sx = sy = 2 relative to the Fixed Point (0, 200). Display the result. Scale it sx = sy = ½ relative to the Fixed Point (50, 60) and then rotate it by 180° on the Pivot Point (50, 60). Display the final result. x y 60 50 125 220

(x,y,z) (x’,y’,z’) x’= x + tx , y’= y + ty , z’= z + tz 3D Translation (x,y,z) (x’,y’,z’) x’= x + tx , y’= y + ty , z’= z + tz Matrix form (4 × 4) T(tx, ty, tz) x y z

3D Rotation z-axis: x y z Matrix form x y z

3D Rotation x-axis: x y z Matrix form

3D Rotation y-axis: x y z Matrix form

3D Scaling x y z Matrix form