Three-Dimensional Graphics

Slides:



Advertisements
Similar presentations
Today Composing transformations 3D Transformations
Advertisements

Computer Graphics 2D & 3D Transformation.
Transformations II Week 2, Wed Jan 17
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Transformations II Week.
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.
Modeling Objects by Polygonal Approximations
1 CSCE 441 Computer Graphics: 2D Transformations Jinxiang Chai.
1 Geometrical Transformation Tong-Yee Lee. 2 Modeling Transform Specify transformation for objects Allow definitions of objects in own coordinate systems.
CS 4731: Computer Graphics Lecture 8: 3D Affine transforms Emmanuel Agu.
2IV60 Computer Graphics 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.
3D Transformation. In 3D, we have x, y, and z. We will continue use column vectors:. Homogenous systems:. 3D Transformation glVertex3f(x, y,z);
TWO DIMENSIONAL GEOMETRIC TRANSFORMATIONS CA 302 Computer Graphics and Visual Programming Aydın Öztürk
2D Transformations.
CIS 350 – I Game Programming Instructor: Rolf Lakaemper.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Jinxiang Chai Composite Transformations and Forward Kinematics 0.
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.
Geometrical Transformations 2 Adapted from Fundamentals of Interactive Computer Graphics, Foley and van Dam, pp , by Geb Thomas.
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.
3D Transformation A 3D point (x,y,z) – x,y, and z coordinates
CS552: Computer Graphics Lecture 4: 2D Graphics. Recap 2D Graphics Coordinate systems 2D Transformations o Translation o Scaling o Rotation Combining.
Composing Transformations
Learning Objectives Affine transformations Affine transformations Translation Translation Rotation Rotation Scaling Scaling Reflection Reflection Shear.
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.
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.
1 Geometric Transformations-II Modelling Transforms By Dr.Ureerat Suksawatchon.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Computer Graphic 2 D Transformation.
CSCE 441 Computer Graphics: 2D Transformations
Transformations University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016 Tamara Munzner.
Forward Projection Pipeline and Transformations CENG 477 Introduction to Computer Graphics.
2D Geometry - points and polygons
Geometric Transformations
Camera Position (5.6) we specify the position and orientation of the camera to determine what will be seen. use gluLookAt (eye x, y, z, at x, y, z, up.
2D Geometric Transformations
Computer Graphics CC416 Week 15 3D Graphics.
Review: Transformations
3D Transformation.
Computer Graphics Lecture 18 3-D Transformations-II Taqdees A
Translation Rotation Scaling
3D Geometric Transformations
Computer Graphics Transformations.
3D Transformations Source & Courtesy: University of Wisconsin,
Introduction to Computer Graphics CS 445 / 645
Review: Transformations
Lecture 7 Geometric Transformations (Continued)
2D Transformations y y x x y x.
Computer Graphics Transformations
Three-Dimensional Graphics
Introduction to Computer Graphics with WebGL
Unit-5 Geometric Objects and Transformations-II
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Transformations.
Chapter IV Spaces and Transforms
Transformations in 3 Dimensions CS /28/2018 Dr. Mark L. Hornick
The Modelview Matrix Lecture 8 Mon, Sep 10, 2007.
Geometric Objects and Transformations (II)
CSCE441: Computer Graphics 2D/3D Transformations
CS1550 Fundamentals For Computer Graphics Transformations-2
Transformations.
TWO DIMENSIONAL TRANSFORMATION
Lecture #6 2D Geometric Transformations
Presentation transcript:

Three-Dimensional Graphics 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 T y x z

Right hand coordinate system X x Y = Z ; Y x Z = X; Z x X = Y; Y y z x +z x Left hand coordinate system Right hand coordinate system

3D transformation Very similar to 2D transformation Translation x’ = x + tx; y’ = y + ty; z’ = z + tz X’ 1 0 0 tx X Y’ 0 1 0 ty Y Z’ 0 0 1 tz Z 1 0 0 0 1 1 OpenGL - glTranslated(tx, ty, tz); = homogeneous coordinates

3D transformation Scaling X’ = X * Sx; Y’ = Y * Sy; Z’ = Z * Sz X’ Sx 0 0 0 X Y’ 0 Sy 0 0 Y Z’ 0 0 Sz 0 Z 1 0 0 0 1 1 OpenGL - glScaled(Sx, Sy, Sz); =

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

3D transformation Rotation about Z – similar to 2D rotation x’ = x cos(q) – y sin(q) y’ = x sin(q) + y cos(q) z’ = z y x + cos(q) -sin(q) 0 0 sin(q) cos(q) 0 0 0 0 1 0 0 0 0 1 z OpenGL - glRotatef(q, 0,0,1)

3D transformation Rotation about y z’ = z cos(q) – x sin(q) + Rotation about y z’ = z cos(q) – x sin(q) x’ = z sin(q) + x cos(q) y’ = y cos(q) 0 sin(q) 0 0 1 0 0 -sin(q) 0 cos(q) 0 0 0 0 1 z x y + OpenGL - glRotatef(q, 0,1,0)

3D transformation Rotation about x y’ = y cos(q) – z sin(q) + Rotation about x y’ = y cos(q) – z sin(q) z’ = y sin(q) + z cos(q) x’ = x 1 0 0 0 0 cos(q) -sin(q) 0 0 sin(q) cos(q) 0 0 0 0 1 y z x + OpenGL - glRotatef(q, 1,0,0)

3D transformation Arbitrary rotation axis (rx,ry,rz) Text pp. 193 explains how to do it We omit the detail here Use OpenGL: glRotatef(angle, rx, ry, rz) Can fill in all 9 entries of the rotation matrix. x z y (rx, ry, rz)

OpenGL Transformation Composition A global modeling transformation matrix (GL_MODELVIEW, called it M here) glMatrixMode(GL_MODELVIEW) The user is responsible to reset it if necessary glLoadIdentity() -> M = 1 0 0 0 1 0 0 0 1

OpenGL Transformation Composition Matrices for performing user-specified transformations are multiplied to the current matrix For example, 1 0 1 glTranslated(1,1 0); M = M x 0 1 1 0 0 1 All the vertices defined within glBegin() / glEnd() will first go through the transformation (modeling transformation) P’ = M x P

Transformation Pipeline Object Local Coordinates Object World Coordinates Modeling transformation …