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.

Slides:



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

COMPUTER GRAPHICS 2D TRANSFORMATIONS.
Geometric Transformations
Three Dimensional Modeling Transformations
1 ME 302 DYNAMICS OF MACHINERY Dynamic Force Analysis IV Dr. Sadettin KAPUCU © 2007 Sadettin Kapucu.
1 Computer Graphics Week6 –Basic Transformations- Translation & Scaling.
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.
2.1 si SI31 Advanced Computer Graphics AGR Lecture 2 Basic Modelling.
IAT 3551 Computer Graphics Overview Color Displays Drawing Pipeline.
Transformations I CS5600Computer Graphics by Rich Riesenfeld 27 February 2002 Lecture Set 5.
Rotations and Translations. Representing a Point 3D A tri-dimensional point A is a reference coordinate system here.
3D Concepts UNIT 3. 3-D Coordinate Spaces Remember what we mean by a 3-D coordinate space x axis y axis z axis P y z x Right-Hand Reference System.
Computer Graphics with OpenGL 3e
CS 4731: Computer Graphics Lecture 8: 3D Affine transforms Emmanuel Agu.
Graphics Programming Graphics Programming: 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.
2D Transformations. World Coordinates Translate Rotate Scale Viewport Transforms Hierarchical Model Transforms Putting it all together.
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.
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.
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.
Transformation of Graphics
Transformations Dr. Amy Zhang.
TWO DIMENSIONAL GEOMETRIC TRANSFORMATIONS CA 302 Computer Graphics and Visual Programming Aydın Öztürk
2D Transformations.
Lecture Notes: Computer Graphics.
Geometric Transformations Jehee Lee Seoul National University.
Lecture 3 Transformations.
Transformations Jehee Lee Seoul National University.
Computer Graphics 2D Transformations. 2 of 74 Contents In today’s lecture we’ll cover the following: –Why transformations –Transformations Translation.
Geometric Objects and Transformation
1 Computer Graphics Week9 -3D Geometric Transformation.
16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.
2D Transformation. Transformation changes an object’s: – Position(Translation) – Size(Scaling) – Orientation(Rotation) – Shape(Deformation) Transformation.
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.
Affine Transformation. Affine Transformations In this lecture, we will continue with the discussion of the remaining affine transformations and composite.
Lecture 3 Transformations. 2D Object Transformations The functions used for modifying the size, location, and orientation of objects or of the camera.
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
Computer Graphics Matrices
Composing Transformations
Learning Objectives Affine transformations Affine transformations Translation Translation Rotation Rotation Scaling Scaling Reflection Reflection Shear.
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.
Geometric Transformations. Transformations Linear transformations Rigid transformations Affine transformations Projective transformations T Global reference.
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.
1 Geometric Transformations Modelling Transforms By Dr.Ureerat Suksawatchon.
Revision Sheet Computer Graphics and Human Interaction By Dr. HANY ELSALAMONY1.
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.
Robotic Arms and Matrices By Chris Wong and Chris Marino.
Forward Projection Pipeline and Transformations CENG 477 Introduction to Computer Graphics.
Lecture 10 Geometric Transformations In 3D(Three- Dimensional)
2D Geometric Transformations
Computer Graphics CC416 Week 15 3D Graphics.
Summary of Properties of 3D Affine Transformations
Review: Transformations
Introduction to Computer Graphics CS 445 / 645
Three-Dimensional Graphics
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Transformations.
Transformations in 3 Dimensions CS /28/2018 Dr. Mark L. Hornick
Three-Dimensional Graphics
Geometric Objects and Transformations (II)
TWO DIMENSIONAL TRANSFORMATION
Presentation transcript:

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 to view our 3D models effectively.  Let us look into 3D transformations in more detail. 2 By Dr. HANY ELSALAMONY

 Just as 2D transformations can be represented by 3 x 3 matrices using homogenous coordinates.  3D transformations can be represented by 4 x 4 matrices.  3D homogenous coordinates are represented as a quadruplet (x, y, z, W).  We discuss the representation of the three most commonly used transformations: translation, scaling, and rotation. 3 By Dr. HANY ELSALAMONY

 The translation matrix T(Tx, Ty, Tz) is defined as:  so any vertex point: 4 By Dr. HANY ELSALAMONY

5

 Scaling is similarly extended to be defined as: By Dr. HANY ELSALAMONY 6

 Recall from Lecture 3 that scaling occurs about a point. This point is called the pivot point. The scaling matrix defined above scales about the origin.  You can define models to have different pivot points by setting the transformation stack appropriately. By Dr. HANY ELSALAMONY 7

 Rotation matrices are defined uniquely based on the axis of rotation and the pivot point.  The axis of rotation is a normalized vector defining the axis in 3D space along which the rotation will occur. By Dr. HANY ELSALAMONY 8

 (A 3D vector will simply be the triplet (x, y, z) defining the direction of the axis). The 2D rotation we saw earlier is a 3D rotation about the z-axis (the vector (0,0,1)), and the world origin (0,0,0) and is defined as: By Dr. HANY ELSALAMONY 9

 Similarly the rotation matrix about the x- axis is defined to be:  and about the y-axis as: By Dr. HANY ELSALAMONY 10

 Just as with 2D transforms, 3D transforms can be composed together to provide desired effects.  The order in which the transforms are applied is important.  Recall from our previous section that the OpenGL commands for matrix operations By Dr. HANY ELSALAMONY 11

 sets the current matrix to be the 4 x 4 identity matrix.  sets the matrix passed in to be the current transformation matrix.  multiplies the current matrix by the matrix passed in as the argument. By Dr. HANY ELSALAMONY 12

 Additionally, OpenGL provides three utility functions for the most commonly used transformations.  multiplies the current transformation matrix by the matrix to move an object by (Tx, Ty, Tz) units By Dr. HANY ELSALAMONY 13

 multiplies the current transformation matrix by a matrix that rotates an object in a counterclockwise direction by theta degrees about the axis defined by the vector (x, y, z).  multiplies the current transformation matrix by a matrix that scales an object by the factors, (Sx, Sy, Sz). By Dr. HANY ELSALAMONY 14

 All three commands are equivalent to producing an appropriate translation, rotation, or scaling matrix and then calling glMultMatrixf0 with that matrix as the argument.  For example, Let us apply some transformations to the famous pyramid that we created earlier. By Dr. HANY ELSALAMONY 15

 We rotate the pyramid about the y-axis and use double buffering to display the rotation as an animation. By Dr. HANY ELSALAMONY 16

 In lecture 3, we saw how to map a two- dimensional world onto the two dimensional screen.  The process was a simple mapping of 2D world coordinates onto the 2D viewport of the window.  Model positions are first clipped against the 2D world coordinates and then mapped into the viewport of the window for display. By Dr. HANY ELSALAMONY 17