Fall CSCI 420: Computer Graphics. 2.2 Transformations. Hao Li.

Size: px
Start display at page:

Download "Fall CSCI 420: Computer Graphics. 2.2 Transformations. Hao Li."

Transcription

1 Fall 2017 CSCI 420: Computer Graphics 2.2 Transformations Hao Li 1

2 OpenGL Transformations Matrices Model-view matrix (4x4 matrix) Projection matrix (4x4 matrix) vertices in 3D Model-view vertices in canonical 3D world coordinate system Projection vertices in 2D 2

3 4x4 Model-view Matrix (this lecture) Translate, rotate, scale objects Position the camera vertices in 3D Model-view vertices in canonical 3D world coordinate system Projection vertices in 2D 3

4 4x4 Model-view Matrix (next lecture) Projection from 3D to 2D vertices in 3D Model-view vertices in canonical 3D world coordinate system Projection vertices in 2D 4

5 OpenGL Transformation Matrices Model-view Projection Manipulated separately in OpenGL (must set matrix mode) : glmatrixmode (GL_MODELVIEW); glmatrixmode (GL_PROJECTION; 5

6 Setting the Current Model-view Matrix Load or post-multiply glmatrixmode (GL_MODELVIEW); glloadidentity(); // very common usage float m[16] = { }; glloadmatrixf(m); // rare, advanced glmultmatrixf(m); // rare, advanced Use library functions gltranslatef(dx, dy, dz); glrotatef(angle, vx, vy, vz); glscalef(sx, sy, sz); 6

7 Translated, rotated, scaled object world 7

8 The rendering coordinate system Initially (after glloadidentity()) : rendering coordinate system = world coordinate system world 8

9 The rendering coordinate system gltranslatef(x, y, z); world [x, y,z] rendering coordinate system 9

10 The rendering coordinate system glrotatef(angle,ax, ay, az); world rendering coordinate system 10

11 The rendering coordinate system glscalef(sx, sy, sz); world rendering coordinate system 11

12 OpenGL code glmatrixmode (GL_MODELVIEW); glloadidentity(); gltranslatef(x, y, z); glrotatef(angle, ax, ay, az); glscalef(sx, sy, sz); renderbunny(); world rendering coordinate system 12

13 Rendering more objects How to obtain this frame? world rendering coordinate system 13

14 Solution 1 How to obtain this frame? Find gltranslate( ), glrotatef( ), glscalef( ) world 14

15 Solution 2: gl{push,pop}matrix glmatrixmode (GL_MODELVIEW); glloadidentity(); // render first bunny glpushmatrix(); // store current matrix gltranslate3f( ); glrotatef( ); renderbunny(); glpopmatrix(); // pop matrix // render second bunny glpushmatrix(); // store current matrix gltranslate3f( ); glrotatef( ); renderbunny(); glpopmatrix(); // pop matrix 15

16 Recall: Linear Algebra 16

17 Scalars Scalars,, from a scalar field () 1 Operations,,,,, Expected laws apply Examples: rationals or reals with addition and multiplication 17

18 Vectors Vectors u, v, w from a vector space u + v u v Vector addition, subtraction Zero vector 0 Scalar multiplication v 18

19 Euclidean Space Vector space over real numbers Three-dimensional in computer graphics Dot product: = u > v = u 1 v 1 + u 2 v 2 + u 3 v 3 0 > 0 =0, u, v are orthogonal if u > v =0 kvk 2 = v > v kvk v defines, the length of 19

20 Lines and Line Segments Parametric form of line: p( ) =p 0 + d Line segment between q and r : for p( ) =(1 )q + r 0 apple apple 1 20

21 Convex Hull Convex hull defined by p = 1 p n p n n =1 for and 0 apple 1 apple 1,i=1...n 21

22 Projection Dot product projects one vector onto another vector u > v = u 1 v 1 + u 2 v 2 + u 3 v 3 = kukkvk cos( ) v (u) =(u > v)v/kvk 2 22

23 Cross Product ka bk = a b sin( ) Cross product is perpendicular to both Right-hand rule a and b 23

24 Plane Plane defined by point and vectors u and v u and v should not be parallel Parametric form: p 0 t(, )=p 0 + u + v n = u v/ku vk is the normal n > (p p 0 )=0if and only if p lies in plane 24

25 Coordinate Systems v 1, v 2, v 3 Let be three linearly independent vectors in a 3-dimensional vector space Can write any vector w as w = 1 v v v 3 for some scalars 1, 2, 3 25

26 Frames p 0 Frame = origin + coordinate system Any point p = p v v v 3 26

27 In Practice, Frames are Often Orthogonal 27

28 Change of Coordinate System u 1, u 2, u 3 v 1, v 2, v 3 Bases { } and { } u i Express basis vectors in terms of v j u 1 = 11 v v v 3 u 2 = 21 v v v 3 u 3 = 31 v v v 3 Represent in matrix form: 2 4 u > 1 u > = M 4 v 1 > v 2 > 3 5 M u > 3 v > 3 28

29 Representing 3D transformations (and model-view matrices) 29

30 Linear Transformations 3 x 3 matrices represent linear transformations a = Mb Can represent rotation, scaling, and reflection Cannot represent translation M 30

31 Homogeneous Coordinates In order to represent rotations, scales AND translations [ 1, 2, 3 ] > Augment by adding a fourth component (1): p =[ 1, 2, 3, 1] > Homogeneous property:, for any scalar p =[ 1, 2, 3, 1] > =[ 1, 2, 3 ] > =0 31

32 Homogeneous Coordinates Homogeneous coordinates are transformed by 4x4 matrices p q q = Ap world 4-vector 4x4 matrix 4-vector 32

33 Affine Transformations (4x4 matrices) Translation Rotation Scaling Any composition of the above Later: projective (perspective) transformations -Also expressible as 4 x 4 matrices! 33

34 Translation q = p + d d =[ x, y, z, 0] > where, p =[x, y, z, 1] >, q =[x 0,y 0,z 0, 1] >, q = Tp Express in matrix form and solve for T 34

35 Scaling x 0 = y 0 = x x y y z 0 = z z Express as q = Sp and solve for S 35

36 Rotation in 2 Dimensions Rotation by about the origin x 0 = x cos( ) y sin( ) y 0 = x sin( )+y cos( ) Express in matrix form: Note that the determinant is 1 36

37 Rotation in 3 Dimensions Orthogonal matrices: RR > = R > R = I det(r) =1 Affine transformation: 37

38 Affine Matrices are Composed by Matrix Multiplication A = A 1 A 2 A 3 Applied from right to left Ap =(A 1 A 2 A 3 )p = A 1 (A 2 (A 3 p)) When calling gltranslate3f, glrotatef, or glscalef, OpenGL forms the corresponding 4x4 matrix, and multiplies the current modelview matrix with it. 38

39 Summary OpenGL Transformation Matrices Vector Spaces Frames Homogeneous Coordinates Transformation Matrices 39

40 Next Time: Viewing & Projection 40

41 Thanks! 41

Transformations. CSCI 420 Computer Graphics Lecture 4

Transformations. CSCI 420 Computer Graphics Lecture 4 CSCI 420 Computer Graphics Lecture 4 Transformations Jernej Barbic University of Southern California Vector Spaces Euclidean Spaces Frames Homogeneous Coordinates Transformation Matrices [Angel, Ch. 4]

More information

Transformations. CSCI 420 Computer Graphics Lecture 5

Transformations. CSCI 420 Computer Graphics Lecture 5 CSCI 420 Computer Graphics Lecture 5 Transformations Jernej Barbic University of Southern California Vector Spaces Euclidean Spaces Frames Homogeneous Coordinates Transformation Matrices [Angel, Ch. 3]

More information

Transformations. OpenGL Transformations. 4x4 Model-view Matrix (this lecture) OpenGL Transformation Matrices. 4x4 Projection Matrix (next lecture)

Transformations. OpenGL Transformations. 4x4 Model-view Matrix (this lecture) OpenGL Transformation Matrices. 4x4 Projection Matrix (next lecture) CSCI 420 Computer Graphics Lecture 5 OpenGL Transformations Transformations Vector Spaces Euclidean Spaces Frames Homogeneous Coordinates Transformation Matrices Jernej Barbic [Angel, Ch. 3] University

More information

Transformations Computer Graphics I Lecture 4

Transformations Computer Graphics I Lecture 4 15-462 Computer Graphics I Lecture 4 Transformations Vector Spaces Affine and Euclidean Spaces Frames Homogeneous Coordinates Transformation Matrices January 23, 2003 [Angel, Ch. 4] Frank Pfenning Carnegie

More information

Transformations Computer Graphics I Lecture 4

Transformations Computer Graphics I Lecture 4 15-462 Computer Graphics I Lecture 4 Transformations Vector Spaces Affine and Euclidean Spaces Frames Homogeneous Coordinates Transformation Matrices January 24, 2002 [Angel, Ch. 4] Frank Pfenning Carnegie

More information

Lecture 4: Transformations and Matrices. CSE Computer Graphics (Fall 2010)

Lecture 4: Transformations and Matrices. CSE Computer Graphics (Fall 2010) Lecture 4: Transformations and Matrices CSE 40166 Computer Graphics (Fall 2010) Overall Objective Define object in object frame Move object to world/scene frame Bring object into camera/eye frame Instancing!

More information

CS 4204 Computer Graphics

CS 4204 Computer Graphics CS 424 Computer Graphics 2D Transformations Yong Cao Virginia Tech References: Introduction to Computer Graphics course notes by Doug Bowman Interactive Computer Graphics, Fourth Edition, Ed Angle Transformations

More information

Computer Graphics. Chapter 7 2D Geometric Transformations

Computer Graphics. Chapter 7 2D Geometric Transformations Computer Graphics Chapter 7 2D Geometric Transformations Chapter 7 Two-Dimensional Geometric Transformations Part III. OpenGL Functions for Two-Dimensional Geometric Transformations OpenGL Geometric Transformation

More information

CSC 470 Computer Graphics

CSC 470 Computer Graphics CSC 470 Computer Graphics Transformations of Objects CSC 470 Computer Graphics, Dr.N. Georgieva, CSI/CUNY 1 Transformations of objects - 2D CSC 470 Computer Graphics, Dr.N. Georgieva, CSI/CUNY 2 Using

More information

Modeling Transform. Chapter 4 Geometric Transformations. Overview. Instancing. Specify transformation for objects 李同益

Modeling Transform. Chapter 4 Geometric Transformations. Overview. Instancing. Specify transformation for objects 李同益 Modeling Transform Chapter 4 Geometric Transformations 李同益 Specify transformation for objects Allow definitions of objects in own coordinate systems Allow use of object definition multiple times in a scene

More information

Lecture 5b. Transformation

Lecture 5b. Transformation Lecture 5b Transformation Refresher Transformation matrices [4 x 4]: the fourth coordinate is homogenous coordinate. Rotation Transformation: Axis of rotation must through origin (0,0,0). If not, translation

More information

GL_MODELVIEW transformation

GL_MODELVIEW transformation lecture 3 view transformations model transformations GL_MODELVIEW transformation view transformations: How do we map from world coordinates to camera/view/eye coordinates? model transformations: How do

More information

CS D Transformation. Junqiao Zhao 赵君峤

CS D Transformation. Junqiao Zhao 赵君峤 CS10101001 3D Transformation Junqiao Zhao 赵君峤 Department of Computer Science and Technology College of Electronics and Information Engineering Tongji University Review Translation Linear transformation

More information

Order of Transformations

Order of Transformations Order of Transformations Because the same transformation is applied to many vertices, the cost of forming a matrix M=ABCD is not significant compared to the cost of computing Mp for many vertices p Note

More information

EECE 478. Learning Objectives. Learning Objectives. Linear Algebra and 3D Geometry. Linear algebra in 3D. Coordinate systems

EECE 478. Learning Objectives. Learning Objectives. Linear Algebra and 3D Geometry. Linear algebra in 3D. Coordinate systems EECE 478 Linear Algebra and 3D Geometry Learning Objectives Linear algebra in 3D Define scalars, points, vectors, lines, planes Manipulate to test geometric properties Coordinate systems Use homogeneous

More information

CS 428: Fall Introduction to. Transformations in OpenGL + hierarchical modeling. Andrew Nealen, Rutgers, /21/2009 1

CS 428: Fall Introduction to. Transformations in OpenGL + hierarchical modeling. Andrew Nealen, Rutgers, /21/2009 1 CS 428: Fall 2009 Introduction to Computer Graphics Transformations in OpenGL + hierarchical modeling 9/21/2009 1 Review of affine transformations Use projective geometry staple of CG Euclidean (x,z) (x,y,z)

More information

Computer Graphics Geometric Transformations

Computer Graphics Geometric Transformations Computer Graphics 2016 6. Geometric Transformations Hongxin Zhang State Key Lab of CAD&CG, Zhejiang University 2016-10-31 Contents Transformations Homogeneous Co-ordinates Matrix Representations of Transformations

More information

CSCI E-74. Simulation and Gaming

CSCI E-74. Simulation and Gaming CSCI E-74 Virtual and Augmented Reality for Simulation and Gaming Fall term 2017 Gianluca De Novi, PhD Lesson 3 General Introduction to OpenGL APIs and TRS Perspective Simulation Perspective simulation

More information

Lecture 6 Sections 4.3, 4.6, 4.7. Wed, Sep 9, 2009

Lecture 6 Sections 4.3, 4.6, 4.7. Wed, Sep 9, 2009 Lecture 6 Sections 4.3, 4.6, 4.7 Hampden-Sydney College Wed, Sep 9, 2009 Outline 1 2 3 4 re are three mutually orthogonal axes: the x-axis, the y-axis, and the z-axis. In the standard viewing position,

More information

Spring 2013, CS 112 Programming Assignment 2 Submission Due: April 26, 2013

Spring 2013, CS 112 Programming Assignment 2 Submission Due: April 26, 2013 Spring 2013, CS 112 Programming Assignment 2 Submission Due: April 26, 2013 PROJECT GOAL: Write a restricted OpenGL library. The goal of the project is to compute all the transformation matrices with your

More information

3.1 Viewing and Projection

3.1 Viewing and Projection Fall 2017 CSCI 420: Computer Graphics 3.1 Viewing and Projection Hao Li http://cs420.hao-li.com 1 Recall: Affine Transformations Given a point [xyz] > form homogeneous coordinates [xyz1] > The transformed

More information

Chapter 3: Modeling Transformation

Chapter 3: Modeling Transformation Chapter 3: Modeling Transformation Graphics Programming, 8th Sep. Graphics and Media Lab. Seoul National University 2011 Fall OpenGL Steps Every step in the graphics pipeline is related to the transformation.

More information

1 Transformations. Chapter 1. Transformations. Department of Computer Science and Engineering 1-1

1 Transformations. Chapter 1. Transformations. Department of Computer Science and Engineering 1-1 Transformations 1-1 Transformations are used within the entire viewing pipeline: Projection from world to view coordinate system View modifications: Panning Zooming Rotation 1-2 Transformations can also

More information

Viewing and Projection

Viewing and Projection CSCI 480 Computer Graphics Lecture 5 Viewing and Projection Shear Transformation Camera Positioning Simple Parallel Projections Simple Perspective Projections [Geri s Game, Pixar, 1997] January 26, 2011

More information

Basic Elements. Geometry is the study of the relationships among objects in an n-dimensional space

Basic Elements. Geometry is the study of the relationships among objects in an n-dimensional space Basic Elements Geometry is the study of the relationships among objects in an n-dimensional space In computer graphics, we are interested in objects that exist in three dimensions We want a minimum set

More information

Reading. Hierarchical Modeling. Symbols and instances. Required: Angel, sections , 9.8. Optional:

Reading. Hierarchical Modeling. Symbols and instances. Required: Angel, sections , 9.8. Optional: Reading Required: Angel, sections 9.1 9.6, 9.8 Optional: Hierarchical Modeling OpenGL rogramming Guide, the Red Book, chapter 3 cse457-07-hierarchical 1 cse457-07-hierarchical 2 Symbols and instances Most

More information

3D Transformation. In 3D, we have x, y, and z. We will continue use column vectors:. Homogenous systems:. x y z. x y z. glvertex3f(x, y,z);

3D Transformation. In 3D, we have x, y, and z. We will continue use column vectors:. Homogenous systems:. x y z. x y z. glvertex3f(x, y,z); 3D Transformation In 3D, we have x, y, and z. We will continue use column vectors:. Homogenous systems:. 3D Transformation glvertex3f(x, y,z); x y z x y z A Right Handle Coordinate System x y z; y z x;

More information

C OMPUTER G RAPHICS Thursday

C OMPUTER G RAPHICS Thursday C OMPUTER G RAPHICS 2017.04.27 Thursday Professor s original PPT http://calab.hanyang.ac.kr/ Courses Computer Graphics practice3.pdf TA s current PPT not uploaded yet GRAPHICS PIPELINE What is Graphics

More information

3D Graphics Pipeline II Clipping. Instructor Stephen J. Guy

3D Graphics Pipeline II Clipping. Instructor Stephen J. Guy 3D Graphics Pipeline II Clipping Instructor Stephen J. Guy 3D Rendering Pipeline (for direct illumination) 3D Geometric Primitives 3D Model Primitives Modeling Transformation 3D World Coordinates Lighting

More information

Computer Graphics. Chapter 5 Geometric Transformations. Somsak Walairacht, Computer Engineering, KMITL

Computer Graphics. Chapter 5 Geometric Transformations. Somsak Walairacht, Computer Engineering, KMITL Chapter 5 Geometric Transformations Somsak Walairacht, Computer Engineering, KMITL 1 Outline Basic Two-Dimensional Geometric Transformations Matrix Representations and Homogeneous Coordinates Inverse Transformations

More information

C O M P U T E R G R A P H I C S. Computer Graphics. Three-Dimensional Graphics I. Guoying Zhao 1 / 52

C O M P U T E R G R A P H I C S. Computer Graphics. Three-Dimensional Graphics I. Guoying Zhao 1 / 52 Computer Graphics Three-Dimensional Graphics I Guoying Zhao 1 / 52 Geometry Guoying Zhao 2 / 52 Objectives Introduce the elements of geometry Scalars Vectors Points Develop mathematical operations among

More information

CIS 636 Interactive Computer Graphics CIS 736 Computer Graphics Spring 2011

CIS 636 Interactive Computer Graphics CIS 736 Computer Graphics Spring 2011 CIS 636 Interactive Computer Graphics CIS 736 Computer Graphics Spring 2011 Lab 1a of 7 OpenGL Setup and Basics Fri 28 Jan 2011 Part 1a (#1 5) due: Thu 03 Feb 2011 (before midnight) The purpose of this

More information

Viewing and Projection

Viewing and Projection CSCI 480 Computer Graphics Lecture 5 Viewing and Projection January 25, 2012 Jernej Barbic University of Southern California Shear Transformation Camera Positioning Simple Parallel Projections Simple Perspective

More information

Chapter 3 - Basic Mathematics for 3D Computer Graphics

Chapter 3 - Basic Mathematics for 3D Computer Graphics Chapter 3 - Basic Mathematics for 3D Computer Graphics Three-Dimensional Geometric Transformations Affine Transformations and Homogeneous Coordinates OpenGL Matrix Logic Translation Add a vector t Geometrical

More information

Hierarchical Modeling. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

Hierarchical Modeling. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell Hierarchical Modeling University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell Reading Angel, sections 9.1-9.6 [reader pp. 169-185] OpenGL Programming Guide, chapter 3 Focus especially

More information

Introduction to Computer Graphics with WebGL

Introduction to Computer Graphics with WebGL Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science Laboratory University of New Mexico WebGL Transformations

More information

Computer Graphics. Chapter 10 Three-Dimensional Viewing

Computer Graphics. Chapter 10 Three-Dimensional Viewing Computer Graphics Chapter 10 Three-Dimensional Viewing Chapter 10 Three-Dimensional Viewing Part I. Overview of 3D Viewing Concept 3D Viewing Pipeline vs. OpenGL Pipeline 3D Viewing-Coordinate Parameters

More information

CS 591B Lecture 9: The OpenGL Rendering Pipeline

CS 591B Lecture 9: The OpenGL Rendering Pipeline CS 591B Lecture 9: The OpenGL Rendering Pipeline 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination Spring 2007 Rui Wang 3D Polygon Rendering Many applications

More information

Rendering Pipeline and Coordinates Transforms

Rendering Pipeline and Coordinates Transforms Rendering Pipeline and Coordinates Transforms Alessandro Martinelli alessandro.martinelli@unipv.it 16 October 2013 Rendering Pipeline (3): Coordinates Transforms Rendering Architecture First Rendering

More information

Modeling with Transformations

Modeling with Transformations Modeling with Transformations Prerequisites This module requires some understanding of 3D geometry, particularly a sense of how objects can be moved around in 3-space. The student should also have some

More information

Transforms 1 Christian Miller CS Fall 2011

Transforms 1 Christian Miller CS Fall 2011 Transforms 1 Christian Miller CS 354 - Fall 2011 Transformations What happens if you multiply a square matrix and a vector together? You get a different vector with the same number of coordinates These

More information

CS380: Computer Graphics 2D Imaging and Transformation. Sung-Eui Yoon ( 윤성의 ) Course URL:

CS380: Computer Graphics 2D Imaging and Transformation. Sung-Eui Yoon ( 윤성의 ) Course URL: CS380: Computer Graphics 2D Imaging and Transformation Sung-Eui Yoon ( 윤성의 ) Course URL: http://sglab.kaist.ac.kr/~sungeui/cg Class Objectives Write down simple 2D transformation matrixes Understand the

More information

Modeling Objects by Polygonal Approximations. Linear and Affine Transformations (Maps)

Modeling Objects by Polygonal Approximations. Linear and Affine Transformations (Maps) Modeling Objects by Polygonal Approximations Define volumetric objects in terms of surfaces patches that surround the volume Each surface patch is approximated set of polygons Each polygon is specified

More information

7. 3D Viewing. Projection: why is projection necessary? CS Dept, Univ of Kentucky

7. 3D Viewing. Projection: why is projection necessary? CS Dept, Univ of Kentucky 7. 3D Viewing Projection: why is projection necessary? 1 7. 3D Viewing Projection: why is projection necessary? Because the display surface is 2D 2 7.1 Projections Perspective projection 3 7.1 Projections

More information

3D Viewing Episode 2

3D Viewing Episode 2 3D Viewing Episode 2 1 Positioning and Orienting the Camera Recall that our projection calculations, whether orthographic or frustum/perspective, were made with the camera at (0, 0, 0) looking down the

More information

CS4202: Test. 1. Write the letter corresponding to the library name next to the statement or statements that describe library.

CS4202: Test. 1. Write the letter corresponding to the library name next to the statement or statements that describe library. CS4202: Test Name: 1. Write the letter corresponding to the library name next to the statement or statements that describe library. (4 points) A. GLUT contains routines that use lower level OpenGL commands

More information

DH2323 DGI16 Lab2 Transformations

DH2323 DGI16 Lab2 Transformations DH2323 DGI16 Lab2 Transformations In Lab1, you used SDL (Simple DirectMedia Layer) which is a cross-platform development library designed to provide low level access to audio and input devices. This lab

More information

Translation. 3D Transformations. Rotation about z axis. Scaling. CS 4620 Lecture 8. 3 Cornell CS4620 Fall 2009!Lecture 8

Translation. 3D Transformations. Rotation about z axis. Scaling. CS 4620 Lecture 8. 3 Cornell CS4620 Fall 2009!Lecture 8 Translation 3D Transformations CS 4620 Lecture 8 1 2 Scaling Rotation about z axis 3 4 Rotation about x axis Rotation about y axis 5 6 Transformations in OpenGL Stack-based manipulation of model-view transformation,

More information

Transformations. Mike Bailey. Oregon State University. Oregon State University. Computer Graphics. transformations.

Transformations. Mike Bailey. Oregon State University. Oregon State University. Computer Graphics. transformations. 1 Transformations Mike Bailey mjb@cs.oregonstate.edu transformations.pptx Geometry vs. Topology 2 Original Object 4 1 2 4 Geometry: Where things are (e.g., coordinates) 3 1 3 2 Geometry = changed Topology

More information

Affine Transformations in 3D

Affine Transformations in 3D Affine Transformations in 3D 1 Affine Transformations in 3D 1 Affine Transformations in 3D General form 2 Translation Elementary 3D Affine Transformations 3 Scaling Around the Origin 4 Along x-axis Shear

More information

CS Computer Graphics: Transformations & The Synthetic Camera

CS Computer Graphics: Transformations & The Synthetic Camera CS 543 - Computer Graphics: Transformations The Snthetic Camera b Robert W. Lindeman gogo@wpi.edu (with help from Emmanuel Agu ;-) Introduction to Transformations A transformation changes an objects Size

More information

Last week. Machiraju/Zhang/Möller

Last week. Machiraju/Zhang/Möller Last week Machiraju/Zhang/Möller 1 Overview of a graphics system Output device Input devices Image formed and stored in frame buffer Machiraju/Zhang/Möller 2 Introduction to CG Torsten Möller 3 Ray tracing:

More information

Lecture 5: Viewing. CSE Computer Graphics (Fall 2010)

Lecture 5: Viewing. CSE Computer Graphics (Fall 2010) Lecture 5: Viewing CSE 40166 Computer Graphics (Fall 2010) Review: from 3D world to 2D pixels 1. Transformations are represented by matrix multiplication. o Modeling o Viewing o Projection 2. Clipping

More information

Vector Algebra Transformations. Lecture 4

Vector Algebra Transformations. Lecture 4 Vector Algebra Transformations Lecture 4 Cornell CS4620 Fall 2008 Lecture 4 2008 Steve Marschner 1 Geometry A part of mathematics concerned with questions of size, shape, and relative positions of figures

More information

Computer Graphics. Coordinate Systems and Change of Frames. Based on slides by Dianna Xu, Bryn Mawr College

Computer Graphics. Coordinate Systems and Change of Frames. Based on slides by Dianna Xu, Bryn Mawr College Computer Graphics Coordinate Systems and Change of Frames Based on slides by Dianna Xu, Bryn Mawr College Linear Independence A set of vectors independent if is linearly If a set of vectors is linearly

More information

CT5510: Computer Graphics. Transformation BOCHANG MOON

CT5510: Computer Graphics. Transformation BOCHANG MOON CT5510: Computer Graphics Transformation BOCHANG MOON 2D Translation Transformations such as rotation and scale can be represented using a matrix M.., How about translation? No way to express this using

More information

CS452/552; EE465/505. Geometry Transformations

CS452/552; EE465/505. Geometry Transformations CS452/552; EE465/505 Geometry Transformations 1-26-15 Outline! Geometry: scalars, points & vectors! Transformations Read: Angel, Chapter 4 (study cube.html/cube.js example) Appendix B: Spaces (vector,

More information

Fachhochschule Regensburg, Germany, February 15, 2017

Fachhochschule Regensburg, Germany, February 15, 2017 s Operations Fachhochschule Regensburg, Germany, February 15, 2017 s Motivating Example s Operations To take a photograph of a scene: Set up your tripod and point camera at the scene (Viewing ) Position

More information

蔡侑庭 (Yu-Ting Tsai) National Chiao Tung University, Taiwan. Prof. Wen-Chieh Lin s CG Slides OpenGL 2.1 Specification

蔡侑庭 (Yu-Ting Tsai) National Chiao Tung University, Taiwan. Prof. Wen-Chieh Lin s CG Slides OpenGL 2.1 Specification 蔡侑庭 (Yu-Ting Tsai) Department of Computer Science National Chiao Tung University, Taiwan Prof. Wen-Chieh Lin s CG Slides OpenGL 2.1 Specification OpenGL Programming Guide, Chap. 3 & Appendix F 2 OpenGL

More information

Prof. Feng Liu. Fall /19/2016

Prof. Feng Liu. Fall /19/2016 Prof. Feng Liu Fall 26 http://www.cs.pdx.edu/~fliu/courses/cs447/ /9/26 Last time More 2D Transformations Homogeneous Coordinates 3D Transformations The Viewing Pipeline 2 Today Perspective projection

More information

Column and row space of a matrix

Column and row space of a matrix Column and row space of a matrix Recall that we can consider matrices as concatenation of rows or columns. c c 2 c 3 A = r r 2 r 3 a a 2 a 3 a 2 a 22 a 23 a 3 a 32 a 33 The space spanned by columns of

More information

Transforms. COMP 575/770 Spring 2013

Transforms. COMP 575/770 Spring 2013 Transforms COMP 575/770 Spring 2013 Transforming Geometry Given any set of points S Could be a 2D shape, a 3D object A transform is a function T that modifies all points in S: T S S T v v S Different transforms

More information

Computer Graphics I. Midterm Examination. October 23, This is a closed-book exam; only one double-sided sheet of notes is permitted.

Computer Graphics I. Midterm Examination. October 23, This is a closed-book exam; only one double-sided sheet of notes is permitted. 15-462 Computer Graphics I Midterm Examination October 23, 2003 Name: Andrew User ID: This is a closed-book exam; only one double-sided sheet of notes is permitted. Write your answer legibly in the space

More information

Overview. By end of the week:

Overview. By end of the week: Overview By end of the week: - Know the basics of git - Make sure we can all compile and run a C++/ OpenGL program - Understand the OpenGL rendering pipeline - Understand how matrices are used for geometric

More information

3.2 Hierarchical Modeling

3.2 Hierarchical Modeling Fall 2018 CSCI 420: Computer Graphics 3.2 Hierarchical Modeling Hao Li http://cs420.hao-li.com 1 Importance of shadows Source: UNC 2 Importance of shadows Source: UNC 3 Importance of shadows Source: UNC

More information

Computer Graphics. Bing-Yu Chen National Taiwan University

Computer Graphics. Bing-Yu Chen National Taiwan University Computer Graphics Bing-Yu Chen National Taiwan University Introduction to OpenGL General OpenGL Introduction An Example OpenGL Program Drawing with OpenGL Transformations Animation and Depth Buffering

More information

Geometry. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Geometry. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science Geometry CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science E. Angel and D. Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012. 1 Objectives Introduce

More information

Computer Graphics Hands-on

Computer Graphics Hands-on Computer Graphics Hands-on Two-Dimensional OpenGL Transformations Objectives To get hands-on experience manipulating the OpenGL current transformation (MODELVIEW) matrix to achieve desired effects To gain

More information

Computer Graphics (CS 4731) Lecture 11: Implementing Transformations. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Computer Graphics (CS 4731) Lecture 11: Implementing Transformations. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI) Computer Graphics (CS 47) Lecture : Implementing Transformations Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) Objectives Learn how to implement transformations in OpenGL

More information

Affine Transformations Computer Graphics Scott D. Anderson

Affine Transformations Computer Graphics Scott D. Anderson Affine Transformations Computer Graphics Scott D. Anderson 1 Linear Combinations To understand the poer of an affine transformation, it s helpful to understand the idea of a linear combination. If e have

More information

Scene Graphs. CS4620/5620: Lecture 7. Announcements. HW 1 out. PA 1 will be out on Wed

Scene Graphs. CS4620/5620: Lecture 7. Announcements. HW 1 out. PA 1 will be out on Wed CS4620/5620: Lecture 7 Scene Graphs 1 Announcements HW 1 out PA 1 will be out on Wed Next week practicum will have an office hour type session on Open GL 2 Example Can represent drawing with flat list

More information

Introduction to OpenGL Transformations, Viewing and Lighting. Ali Bigdelou

Introduction to OpenGL Transformations, Viewing and Lighting. Ali Bigdelou Introduction to OpenGL Transformations, Viewing and Lighting Ali Bigdelou Modeling From Points to Polygonal Objects Vertices (points) are positioned in the virtual 3D scene Connect points to form polygons

More information

OpenGL Transformations

OpenGL Transformations OpenGL Transformations R. J. Renka Department of Computer Science & Engineering University of North Texas 02/18/2014 Introduction The most essential aspect of OpenGL is the vertex pipeline described in

More information

Computer Graphics: Viewing in 3-D. Course Website:

Computer Graphics: Viewing in 3-D. Course Website: Computer Graphics: Viewing in 3-D Course Website: http://www.comp.dit.ie/bmacnamee 2 Contents Transformations in 3-D How do transformations in 3-D work? 3-D homogeneous coordinates and matrix based transformations

More information

The Viewing Pipeline adaptation of Paul Bunn & Kerryn Hugo s notes

The Viewing Pipeline adaptation of Paul Bunn & Kerryn Hugo s notes The Viewing Pipeline adaptation of Paul Bunn & Kerryn Hugo s notes What is it? The viewing pipeline is the procession of operations that are applied to the OpenGL matrices, in order to create a 2D representation

More information

Where We Are: Static Models

Where We Are: Static Models Where We Are: Static Models Our models are static sets of polygons We can only move them via transformations translate, scale, rotate, or any other 4x4 matrix This does not allow us to simulate very realistic

More information

Describe the Orthographic and Perspective projections. How do we combine together transform matrices?

Describe the Orthographic and Perspective projections. How do we combine together transform matrices? Aims and objectives By the end of the lecture you will be able to Work with multiple transform matrices Describe the viewing process in OpenGL Design and build a camera control APIs Describe the Orthographic

More information

GEOMETRIC TRANSFORMATIONS AND VIEWING

GEOMETRIC TRANSFORMATIONS AND VIEWING GEOMETRIC TRANSFORMATIONS AND VIEWING 2D and 3D 1/44 2D TRANSFORMATIONS HOMOGENIZED Transformation Scaling Rotation Translation Matrix s x s y cosθ sinθ sinθ cosθ 1 dx 1 dy These 3 transformations are

More information

Perspective projection and Transformations

Perspective projection and Transformations Perspective projection and Transformations The pinhole camera The pinhole camera P = (X,,) p = (x,y) O λ = 0 Q λ = O λ = 1 Q λ = P =-1 Q λ X = 0 + λ X 0, 0 + λ 0, 0 + λ 0 = (λx, λ, λ) The pinhole camera

More information

Computer Graphics CS 543 Lecture 5 (Part 2) Implementing Transformations

Computer Graphics CS 543 Lecture 5 (Part 2) Implementing Transformations Computer Graphics CS 543 Lecture 5 (Part 2) Implementing Transformations Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) Objectives Learn how to implement transformations

More information

Transformation Pipeline

Transformation Pipeline Transformation Pipeline Local (Object) Space Modeling World Space Clip Space Projection Eye Space Viewing Perspective divide NDC space Normalized l d Device Coordinatesd Viewport mapping Screen space Coordinate

More information

Computer graphics MN1

Computer graphics MN1 Computer graphics MN1 http://www.opengl.org Todays lecture What is OpenGL? How do I use it? Rendering pipeline Points, vertices, lines,, polygons Matrices and transformations Lighting and shading Code

More information

Using GLU/GLUT Objects

Using GLU/GLUT Objects Using GLU/GLUT Objects GLU/GLUT provides very simple object primitives glutwirecone glutwirecube glucylinder glutwireteapot GLU/GLUT Objects Each glu/glut object has its default size, position, and orientation

More information

Computer Graphics 7: Viewing in 3-D

Computer Graphics 7: Viewing in 3-D Computer Graphics 7: Viewing in 3-D In today s lecture we are going to have a look at: Transformations in 3-D How do transformations in 3-D work? Contents 3-D homogeneous coordinates and matrix based transformations

More information

CS452/552; EE465/505. Transformations

CS452/552; EE465/505. Transformations CS452/552; EE465/55 Transformations 1-29-15 Outline! Transformations Read: Angel, Chapter 4 (study cube.html/cube.js example) Helpful links: Linear Algebra: Khan Academy Lab1 is posted on github, due:

More information

CSE Intro to Computer Graphics. ANSWER KEY: Midterm Examination. November 18, Instructor: Sam Buss, UC San Diego

CSE Intro to Computer Graphics. ANSWER KEY: Midterm Examination. November 18, Instructor: Sam Buss, UC San Diego CSE 167 - Intro to Computer Graphics ANSWER KEY: Midterm Examination November 18, 2003 Instructor: Sam Buss, UC San Diego Write your name or initials on every page before beginning the exam. You have 75

More information

The Importance of Matrices in the DirectX API. by adding support in the programming language for frequently used calculations.

The Importance of Matrices in the DirectX API. by adding support in the programming language for frequently used calculations. Hermann Chong Dr. King Linear Algebra Applications 28 November 2001 The Importance of Matrices in the DirectX API In the world of 3D gaming, there are two APIs (Application Program Interface) that reign

More information

Today. Today. Introduction. Matrices. Matrices. Computergrafik. Transformations & matrices Introduction Matrices

Today. Today. Introduction. Matrices. Matrices. Computergrafik. Transformations & matrices Introduction Matrices Computergrafik Matthias Zwicker Universität Bern Herbst 2008 Today Transformations & matrices Introduction Matrices Homogeneous Affine transformations Concatenating transformations Change of Common coordinate

More information

S U N G - E U I YO O N, K A I S T R E N D E R I N G F R E E LY A VA I L A B L E O N T H E I N T E R N E T

S U N G - E U I YO O N, K A I S T R E N D E R I N G F R E E LY A VA I L A B L E O N T H E I N T E R N E T S U N G - E U I YO O N, K A I S T R E N D E R I N G F R E E LY A VA I L A B L E O N T H E I N T E R N E T Copyright 2018 Sung-eui Yoon, KAIST freely available on the internet http://sglab.kaist.ac.kr/~sungeui/render

More information

Transformation Algebra

Transformation Algebra Transformation Algebra R. J. Renka Department of Computer Science & Engineering University of North Texas 0/07/205 Linear Transformations A point with Cartesian coordinates (x, y, z) is taken to be a column

More information

Computer Viewing Computer Graphics I, Fall 2008

Computer Viewing Computer Graphics I, Fall 2008 Computer Viewing 1 Objectives Introduce mathematics of projection Introduce OpenGL viewing functions Look at alternate viewing APIs 2 Computer Viewing Three aspects of viewing process All implemented in

More information

Coordinate Transformations & Homogeneous Coordinates

Coordinate Transformations & Homogeneous Coordinates CS-C31 (Introduction to) Computer Graphics Jaakko Lehtinen Coordinate Transformations & Homogeneous Coordinates Lots of slides from Frédo Durand CS-C31 Fall 216 Lehtinen Outline Intro to Transformations

More information

CS230 : Computer Graphics Lecture 6: Viewing Transformations. Tamar Shinar Computer Science & Engineering UC Riverside

CS230 : Computer Graphics Lecture 6: Viewing Transformations. Tamar Shinar Computer Science & Engineering UC Riverside CS230 : Computer Graphics Lecture 6: Viewing Transformations Tamar Shinar Computer Science & Engineering UC Riverside Rendering approaches 1. image-oriented foreach pixel... 2. object-oriented foreach

More information

COMP Computer Graphics and Image Processing. 5: Viewing 1: The camera. In part 1 of our study of Viewing, we ll look at ˆʹ U ˆ ʹ F ˆʹ S

COMP Computer Graphics and Image Processing. 5: Viewing 1: The camera. In part 1 of our study of Viewing, we ll look at ˆʹ U ˆ ʹ F ˆʹ S COMP27112 Û ˆF Ŝ Computer Graphics and Image Processing ˆʹ U ˆ ʹ F C E 5: iewing 1: The camera ˆʹ S Toby.Howard@manchester.ac.uk 1 Introduction In part 1 of our study of iewing, we ll look at iewing in

More information

Modeling Objects. Modeling. Symbol-Instance Table. Instance Transformation. Each appearance of the object in the model is an instance

Modeling Objects. Modeling. Symbol-Instance Table. Instance Transformation. Each appearance of the object in the model is an instance Modeling Objects Modeling Hierarchical Transformations Hierarchical Models Scene Graphs A prototype has a default size, position, and orientation You need to perform modeling transformations to position

More information

Luiz Fernando Martha André Pereira

Luiz Fernando Martha André Pereira Computer Graphics for Engineering Numerical simulation in technical sciences Color / OpenGL Luiz Fernando Martha André Pereira Graz, Austria June 2014 To Remember Computer Graphics Data Processing Data

More information

Computer Graphics Lighting

Computer Graphics Lighting Lighting 1 Mike Bailey mjb@cs.oregonstate.edu This work is licensed under a Creative Commons Attribution-NonCommercial- NoDerivatives 4.0 International License Lighting.pptx Why Do We Care About Lighting?

More information

Computer Graphics Lighting. Why Do We Care About Lighting?

Computer Graphics Lighting. Why Do We Care About Lighting? Lighting 1 Mike Bailey mjb@cs.oregonstate.edu This work is licensed under a Creative Commons Attribution-NonCommercial- NoDerivatives 4.0 International License Lighting.pptx Why Do We Care About Lighting?

More information

Two possible ways to specify transformations. Each part of the object is transformed independently relative to the origin

Two possible ways to specify transformations. Each part of the object is transformed independently relative to the origin Transformations Two possible ways to specify transformations Each part of the object is transformed independently relative to the origin - Not convenient! z y Translate the base by (5,0,0); Translate the

More information

Transformations IV. Week 3, Wed Jan 20

Transformations IV. Week 3, Wed Jan 20 University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2010 Tamara Munzner Transformations IV Week 3, Wed Jan 20 http://www.ugrad.cs.ubc.ca/~cs314/vjan2010 Assignments 2 Correction: Assignments

More information