8. 2D Coordinate Operations Assoc.Prof.Dr. Ahmet Zafer Şenalp Mechanical Engineering Department Gebze.

Slides:



Advertisements
Similar presentations
Computer Graphics: 2D Transformations
Advertisements

10. 3D Coordinate Operations Dr. Ahmet Zafer Şenalp Makine Mühendisliği Bölümü Gebze Yüksek Teknoloji.
COMPUTER GRAPHICS 2D TRANSFORMATIONS.
Gursharan Singh Tatla TRANSFORMATIONS Gursharan Singh Tatla Gursharan Singh Tatla.
Computer Graphics Lecture 4 Geometry & Transformations.
Transformations We want to be able to make changes to the image larger/smaller rotate move This can be efficiently achieved through mathematical operations.
Geometric Transformations
11. Wireframe Perspective Display Assoc.Prof.Dr. Ahmet Zafer Şenalp Mechanical Engineering Department.
10. 3D Coordinate Operations Assoc.Prof.Dr. Ahmet Zafer Şenalp Mechanical Engineering Department Gebze.
2. Review of Matrix Algebra Dr. Ahmet Zafer Şenalp Mechanical Engineering Department Gebze Technical.
ME 521 Computer Aided Design Assoc.Dr. Ahmet Zafer Şenalp Mechanical Engineering Department Gebze.
Linear Algebra and SVD (Some slides adapted from Octavia Camps)
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.
1 CSCE 441 Computer Graphics: 2D Transformations Jinxiang Chai.
Course Website: Computer Graphics 3: 2D Transformations.
Math for CSLecture 11 Mathematical Methods for Computer Science Lecture 1.
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.
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.
The linear algebra of Canadarm
Mathematical Fundamentals
CS 480/680 Computer Graphics Representation Dr. Frederick C Harris, Jr. Fall 2012.
ME 520 Fundamentals of Finite Element Analysis
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
7-Bar Elements in 3-D Space Dr. Ahmet Zafer Şenalp Mechanical Engineering Department Gebze Technical.
2D Transformation of Graphics
Lecture Notes: Computer Graphics.
2D Geometric Transformations
6-Bar Elements in 2-D Space Dr. Ahmet Zafer Şenalp Mechanical Engineering Department Gebze Technical.
Geometric Transformations
10-Beam Elements in 2-D Space (Plane Frame Element) Dr. Ahmet Zafer Şenalp Mechanical Engineering.
9-Beam Element with Axial Force Dr. Ahmet Zafer Şenalp Mechanical Engineering Department Gebze Technical.
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.
GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi.
12-Perspective Depth Assoc.Dr. Ahmet Zafer Şenalp Mechanical Engineering Department Gebze Technical.
11. Plastic Anisotropy Assoc.Prof.Dr. Ahmet Zafer Şenalp Mechanical Engineering Department Gebze Technical.
2D Geometric Transformation Translation A translation is applied to an object by repositioning it along a straight-line path from one coordinate location.
11-Beam Elements in 3-D Space (Space Frame Element)
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.
6. Strain Assoc.Prof.Dr. Ahmet Zafer Şenalp Mechanical Engineering Department Gebze Technical University.
Computer Graphics Lecture 11 2D Transformations I Taqdees A. Siddiqi
Computer Graphic 2 D Transformation.
CSCE 441 Computer Graphics: 2D Transformations
Modeling Transformation
2D Geometry - points and polygons
Computer Graphics 2D Transformations
Spatcial Description & Transformation
11. Viewing Transformations
Computer Graphics Transformations.
2D Transformations with Matrices
3D Geometric Transformations
13. Wireframe Perspective Display
Computer Graphics Transformations.
Lecture 7 Geometric Transformations (Continued)
2D Transformations y y x x y x.
Three-Dimensional Graphics
12. 3D Coordinate Operations
Mobile Robot Kinematics
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Transformations.
Three-Dimensional Graphics
Geometric Objects and Transformations (II)
Rendering – Matrix Transformations and the Graphics Pipeline
Presentation transcript:

8. 2D Coordinate Operations Assoc.Prof.Dr. Ahmet Zafer Şenalp Mechanical Engineering Department Gebze Technical University ME 521 Computer Aided Design

Introduction Many of the engineering problems are solved by defining the model in 2D. Within these problems;  Standard kinematics problems  Some mechanism movements  Shear force bending moment graphics of structural members can be listed. For the representation of these problems basic graphics elements such as line, circle are needed. Additionally transformations should be applied to the basic graphics elements to obtain the desired graphical view. Fundamental operations in graphics work can be summarized as follows:  Translation  Rotation  Scaling Dr. Ahmet Zafer Şenalp ME Mechanical Engineering Department, GTU 8. 2D Coordinate Operations

Translation: A translation is moving every point a constant distance in a specified direction. It is one of the rigid motions.rigid motions Mathematically; x' = x + Tx y' = y + Ty Here; x y : initial coordinates x' y' : final coordinates. Dr. Ahmet Zafer Şenalp ME Mechanical Engineering Department, GTU 8. 2D Coordinate Operations

A triangle is given below with [(20,0) (60,0) (40,100)] vertex coornitaes This triangle is translated 100 units to right 10 units to up; Tx = 100, Ty = 10 and x' = x + Tx y' = y + Ty The new vertex coordinates of the triangle is: [(120,10) (160,10) (140,110)] Öteleme örneği Dr. Ahmet Zafer Şenalp ME Mechanical Engineering Department, GTU 8. 2D Coordinate Operations

Rotation: A point (x,y) is rotated in counter clockwise direction around the center of the coordinate axis. The new coordinates can be calculated as follows: ( PS: Obeying to the right hand rule counter clockwise direction is taken to be positive.) x = r cos  y = r sin  x’ = r cos (  +  ) = r ( cos  cos  - sin  sin  ) = r cos  cos  - r sin  sin  = x cos  - y sin  y’ = r sin (  +  ) = r ( sin  cos  + cos  sin  ) = r sin  cos  + r sin  cos  = x sin  + y cos  As a result: x’ = x cos  - y sin  y’ = x sin  + y cos  İs obtained. P(x,y) noktasının saat yönünün tersi yönünde  açısıyla döndürülmesi Dr. Ahmet Zafer Şenalp ME Mechanical Engineering Department, GTU 8. 2D Coordinate Operations

The triangle given in translation example with initial coordinates [(20,0) (60,0) (40,100)] is rotated around the coordinat system’s center in clock wise direction with an angle of 45 degrees. The new coordinates of the triangle are: PS: These equations are used for the rotation about center point O only. Dr. Ahmet Zafer Şenalp ME Mechanical Engineering Department, GTU 8. 2D Coordinate Operations

Scaling: To change the scale of an object x' = x Sx y' = y Sy equations are used. Dr. Ahmet Zafer Şenalp ME Mechanical Engineering Department, GTU 8. 2D Coordinate Operations

Given the triangle with vertex coordinates [(20,0) (60,0) (40,100)] Calculate the new coordinates when the size of the triangle is scaled by 2 Sx = Sy =2 New coordinates are calculated to be: (40,0) (120,0) (80,200) Dr. Ahmet Zafer Şenalp ME Mechanical Engineering Department, GTU 8. 2D Coordinate Operations

PS: When Sx and Sy are used with different magnitudes the image will be distorted. By using scaling mirror images shown below can be obtained. Dr. Ahmet Zafer Şenalp ME Mechanical Engineering Department, GTU 8. 2D Coordinate Operations

Sequential transformations can be concatenated. As an example a rotation about an arbitrary point can be written as: translation + rotation + translation The mentioned sequence is important. Example: A body; 1.Rotated about coordinate system’s center 90 degrees counter clock wise 2.Translated -80 units in x direction (Tx = - 80, Ty = 0); İs obtained. If operation sequence is changed different result will be obtained. Concatenation is prefered as less arithmetic operation is necessary. Rotationx' = yTranslationx'' = x' - 80 y' = -xy'' = y' Concatenationx'' = y - 80 y'' = -x or Dr. Ahmet Zafer Şenalp ME Mechanical Engineering Department, GTU 8. 2D Coordinate Operations

2D transfomations can be conducted by using a 3 x 3 matrix (x, y) coordinates are transformed to ( x', y‘): addition of units to the [ x, y ] vector enables it to be transformed by the 3 x 3 matrix Dr. Ahmet Zafer Şenalp ME Mechanical Engineering Department, GTU 8. 2D Coordinate Operations

Translation: Rotation: Scaling: Dr. Ahmet Zafer Şenalp ME Mechanical Engineering Department, GTU 8. 2D Coordinate Operations

Consider scaling Sx = Sy = 2, then translate it with Tx = 10, Ty = 0 Scaling: Translate: Dr. Ahmet Zafer Şenalp ME Mechanical Engineering Department, GTU 8. 2D Coordinate Operations

The result [ x' y' 1] is merely an intermediate one and we can eliminate it by subtituting the first equation into the second: The two 3 x 3 matrices are independent of the ( x, y ) points being transformed, and are derived only from the parameters specified in the transformation sequence ( Sx, Sy, Tx, Ty). Therefore the product of the two matrices can be used. Thus the product of two matrix transformations represents the concatenation of those transforms. Irrespective of the number of transformation, we can always concatenate so that one 3 x 3 matrix represents the entire sequence. Dr. Ahmet Zafer Şenalp ME Mechanical Engineering Department, GTU 8. 2D Coordinate Operations

Suppose we wish to derive a transformation which will rotate a point through a clockwise angle about a point (Px, Py). 1.The rotation transformation can be applied to rotate points about the origin. Therefore we must first translate points so that (Px, Py) becomes the origin: 2.Then rotation is applied. Dr. Ahmet Zafer Şenalp ME Mechanical Engineering Department, GTU 8. 2D Coordinate Operations

3.And finally we translate the point so that the origin is returned to (Px, Py): These operations may be concatenated: If Px, Py and are known three matrices can be multiplied to yield one transformation matrix Dr. Ahmet Zafer Şenalp ME Mechanical Engineering Department, GTU 8. 2D Coordinate Operations

When generating a picture for display, we may need to apply a transformation to a large number of points. This application must be as efficient as possible. the computation seems at a first glance to require 9 multiplications and 6 additions. However, in the formulation given here, the third column of the 3 x 3 matrix will always be: even if the matrix is result of many concatenations, the computations for x' and y' reduces to: x' = ax + by +c y' = dx + ey +f which reduces to 4 multiplications and 4 additions. Dr. Ahmet Zafer Şenalp ME Mechanical Engineering Department, GTU 8. 2D Coordinate Operations

A matrix rotation for this abbreviated computation is: The transformation matrix is now a 3 x 2 matrix. However we cannot concatenate two 3 x 2 matrices by multiplying them together: before we multiply them we must first return them to 3 x 3 form by attaching a third column. Dr. Ahmet Zafer Şenalp ME Mechanical Engineering Department, GTU 8. 2D Coordinate Operations