CS Computer Graphics: Transformations & The Synthetic Camera

Size: px
Start display at page:

Download "CS Computer Graphics: Transformations & The Synthetic Camera"

Transcription

1 CS Computer Graphics: Transformations The Snthetic Camera b Robert W. Lindeman gogo@wpi.edu (with help from Emmanuel Agu ;-)

2 Introduction to Transformations A transformation changes an objects Size (scaling) Position (translation) Orientation (rotation) Shape (shear) We will introduce first in 2D or (,), build intuition Later, talk about 3D and 4D? Transform object b appling sequence of matri multiplications to object vertices R.W. Lindeman - WPI Dept. of Computer Science 2

3 Wh Matrices? All transformations can be performed using matri/vector multiplication Allows pre-multiplication of all matrices Note: point (, ) needs to be represented as (,, ), also called homogeneous coordinates R.W. Lindeman - WPI Dept. of Computer Science 3

4 Point Representation We use a column matri (2 matri) to represent a 2D point General form of transformation of a point (, ) to (, ) can be written as: = a + b + c = d + e + f or a b c = d e f * R.W. Lindeman - WPI Dept. of Computer Science 4

5 Translation To reposition a point along a straight line Given point (, ) and translation distance (t, t ) The new point: (, ) (, ) = + t = + t (,) or = P T where = P + P P = T = t t R.W. Lindeman - WPI Dept. of Computer Science 5

6 R.W. Lindeman - WPI Dept. of Computer Science D Translation Matri t t = + use 3 vector t t = * Note: it becomes a matri-vector multiplication = + t = + t

7 Translation of Objects How to translate an object with multiple vertices? Translate individual vertices R.W. Lindeman - WPI Dept. of Computer Science 7

8 2D Scaling Scale: Alter object size b scaling factor (s, s). i.e., = * S = * S = S S (4,4) (2,2) S = 2, S = 2 (,) (2,2) R.W. Lindeman - WPI Dept. of Computer Science 8

9 R.W. Lindeman - WPI Dept. of Computer Science D Scaling Matri = S S = S S = * S = * S

10 Shearing Y coordinates are unaffected, but coordinates are translated linearl with That is = + *h = h is fraction of to be added to h = ( R.W. Lindeman - WPI Dept. of Computer Science

11 2D Rotation Default rotation center is origin (,) θ θ> : Rotate counter clockwise θ θ< : Rotate clockwise R.W. Lindeman - WPI Dept. of Computer Science

12 2D Rotation (cont.) (,) -> Rotate about the origin b θ (, ) (, ) θ r φ (,) How to compute (, )? = r*cos(φ) = r*sin(φ) = r*cos(φ +θ) = r*sin(φ +θ) R.W. Lindeman - WPI Dept. of Computer Science 2

13 2D Rotation (cont.) Using trig. identities cos( + ) = cos cos sin sin (, ) sin( + ) = sin cos + cos sin = cos(θ) sin(θ) = sin(θ) + cos(θ) θ r φ (,) Matri form? = cos( ( ) sin( ( ) sin( ( ) cos( ( ) R.W. Lindeman - WPI Dept. of Computer Science 3

14 R.W. Lindeman - WPI Dept. of Computer Science D Rotation Matri (,) (, ) θ φ r = ) cos( ) sin( ) sin( ) cos( ( ( ( ( = ) cos( ) sin( ) sin( ) cos( ( ( ( (

15 2D Rotation How to rotate an object with multiple vertices? Rotate individual Vertices θ R.W. Lindeman - WPI Dept. of Computer Science 5

16 R.W. Lindeman - WPI Dept. of Computer Science 6 Arbitrar Rotation Center To rotate about arbitrar point P = (P, P) b θ: Translate object b T(-P, -P) so that P coincides with origin Rotate the object b R(θ) Translate object back: T(P, P) In matri form T(P,P) R(θ) T(-P,-P) * P Similar for arbitrar scaling anchor = ) cos( ) sin( ) sin( ) cos( P P P P ( ( ( (

17 Composing Transformations Composing transformations Appling several transforms in succession to form one overall transformation Eample M X M2 X M3 X P where M, M2, M3 are transform matrices applied to P Be careful with the order For eample Translate b (5, ), then rotate 6 degrees is NOT same as Rotate b 6 degrees, then translate b (5, ) R.W. Lindeman - WPI Dept. of Computer Science 7

18 OpenGL Transformations Designed for 3D For 2D, simpl ignore z dimension Translation: gltranslated( t, t, tz ) gltranslated( t, t, ) => for 2D Rotation: glrotated( angle, V, V, Vz ) glrotated( angle,,, ) => for 2D Scaling: glscaled( s, s, sz ) glscaled( s, s, ) => for 2D R.W. Lindeman - WPI Dept. of Computer Science 8

19 3D Transformations Affine transformations Mappings of points to new points that retain certain relationships Lines remain lines Several transformations can be combined into a single matri Two was to think about transformations Object transformations All points of an object are transformed Coordinate transformations The coordinate sstem is transformed, and models remain defined relative to this R.W. Lindeman - WPI Dept. of Computer Science 9

20 3D Transformations (cont.) Scale glscaled( s, s, sz ): Scale object b (s, s, sz) Translate gltranslated( d, d, dz ): Translate object b (d, d, dz) Rotate glrotated( angle, u, u, uz ): Rotate b angle about an ais passing through origin and (u, u, uz) OpenGL Creates a matri for each transformation Multiplies matrices together to form a single, combined matri Transformation matri is called modelview matri R.W. Lindeman - WPI Dept. of Computer Science 2

21 Eample: Translation The vertices of an object are mapped to new points Similarl for scaling and rotation R.W. Lindeman - WPI Dept. of Computer Science 2

22 OpenGL Matrices Graphics pipeline takes all vertices through a series of operations R.W. Lindeman - WPI Dept. of Computer Science 22

23 OpenGL Matrices and the Pipeline OpenGL uses three matrices for geometr Modelview matri Projection matri Viewport matri Modelview matri Combination of modeling matri M and camera transforms V Other OpenGL matrices include teture and color matrices glmatrimode command selects matri mode glmatrimode parameters GL_MODELVIEW, GL_PROJECTION, GL_TEXTURE, etc. Ma initialize matrices with glloadidentit( ) R.W. Lindeman - WPI Dept. of Computer Science 23

24 OpenGL Matrices and the Pipeline OpenGL matri operations are 44 matrices Graphics card Fast 44 multiplier -> tremendous speedup R.W. Lindeman - WPI Dept. of Computer Science 24

25 View Frustum Side walls determined b window borders Other walls are programmer defined Near clipping plane Far clipping plane Transform 3D models to 2D Project points/vertices inside view volume onto view window using parallel lines along z-ais R.W. Lindeman - WPI Dept. of Computer Science 25

26 Tpes of Projections Different tpes of projections? Different view volume shapes Different visual effects Eample projections Parallel (a.k.a. orthographic) Perspective Parallel is simple Will use this for intro, epand later R.W. Lindeman - WPI Dept. of Computer Science 26

27 OpenGL Matrices and the Pipeline Projection matri Scales and shifts each verte in a particular wa View volume lies inside cube of to Reverses sense of z increasing z = increasing depth Effectivel squishes view volume down to cube centered at Clipping in 3D then eliminates portions outside view frustum Viewport matri: Maps surviving portion of block (cube) into a 3D viewport Retains a measure of the depth of a point R.W. Lindeman - WPI Dept. of Computer Science 27

28 Lighting and Shading Light components: Diffuse, ambient, specular OpenGL gllightfv( ), gllightf( ) Materials OpenGL glmaterialfv( ), glmaterialf( ) R.W. Lindeman - WPI Dept. of Computer Science 28

29 A Snthetic Camera Define: Ee position LookAt point Up vector (if spinning: confusing) Programmer knows scene, chooses: ee lookat Up direction usuall set to (,, ) OpenGL: glulookat( ee.pos[x], ee.pos[y], ee.pos[z], look.pos[x], look.pos[y], look.pos[z], up.vec[x], up.vec[y], up.vec[z] ); R.W. Lindeman - WPI Dept. of Computer Science 29

30 A Snthetic Camera (cont.) R.W. Lindeman - WPI Dept. of Computer Science 3

IMGD The Game Development Process: 3D Modeling and Transformations

IMGD The Game Development Process: 3D Modeling and Transformations IMGD - The Game Development Process: 3D Modeling and Transformations b Robert W. Lindeman (gogo@wpi.edu Kent Quirk (kent_quirk@cognito.com (with lots of input from Mark Clapool! Overview of 3D Modeling

More information

CS 543: Computer Graphics. Projection

CS 543: Computer Graphics. Projection CS 543: Computer Graphics Projection Robert W. Lindeman Associate Professor Interactive Media & Game Development Department of Computer Science Worcester Poltechnic Institute gogo@wpi.edu with lots of

More information

6. Modelview Transformations

6. Modelview Transformations 6. Modelview Transformations Transformation Basics Transformations map coordinates from one frame of reference to another through matri multiplications Basic transformation operations include: - translation

More information

1. We ll look at: Types of geometrical transformation. Vector and matrix representations

1. We ll look at: Types of geometrical transformation. Vector and matrix representations Tob Howard COMP272 Computer Graphics and Image Processing 3: Transformations Tob.Howard@manchester.ac.uk Introduction We ll look at: Tpes of geometrical transformation Vector and matri representations

More information

CPSC 314, Midterm Exam 1. 9 Feb 2007

CPSC 314, Midterm Exam 1. 9 Feb 2007 CPSC, Midterm Eam 9 Feb 007 Closed book, no calculators or other electronic devices. Cell phones must be turned off. Place our photo ID face up on our desk. One single-sided sheet of handwritten notes

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

CS 543: Computer Graphics. 3D Transformations

CS 543: Computer Graphics. 3D Transformations CS 543: Coputer Graphics 3D Transforations Robert W. Lindean Associate Professor Interactive Media Gae Developent Departent of Coputer Science Worcester Poltechnic Institute gogo@wpi.edu (with lots of

More information

Viewing/Projection IV. Week 4, Fri Jan 29

Viewing/Projection IV. Week 4, Fri Jan 29 Universit of British Columbia CPSC 314 Computer Graphics Jan-Apr 2010 Tamara Munner Viewing/Projection IV Week 4, Fri Jan 29 http://www.ugrad.cs.ubc.ca/~cs314/vjan2010 News etra TA office hours in lab

More information

(x, y) (ρ, θ) ρ θ. Polar Coordinates. Cartesian Coordinates

(x, y) (ρ, θ) ρ θ. Polar Coordinates. Cartesian Coordinates Coordinate Sstems Point Representation in two dimensions Cartesian Coordinates: (; ) Polar Coordinates: (; ) (, ) ρ θ (ρ, θ) Cartesian Coordinates Polar Coordinates p = CPS1, 9: Computer Graphics D Geometric

More information

CSE528 Computer Graphics: Theory, Algorithms, and Applications

CSE528 Computer Graphics: Theory, Algorithms, and Applications CSE528 Computer Graphics: Theor, Algorithms, and Applications Hong Qin State Universit of New York at Ston Brook (Ston Brook Universit) Ston Brook, New York 794--44 Tel: (63)632-845; Fa: (63)632-8334 qin@cs.sunsb.edu

More information

Viewing and Projection

Viewing and Projection Viewing and Projection Sheelagh Carpendale Camera metaphor. choose camera position 2. set up and organie objects 3. choose a lens 4. take the picture View Volumes what gets into the scene perspective view

More information

GLOBAL EDITION. Interactive Computer Graphics. A Top-Down Approach with WebGL SEVENTH EDITION. Edward Angel Dave Shreiner

GLOBAL EDITION. Interactive Computer Graphics. A Top-Down Approach with WebGL SEVENTH EDITION. Edward Angel Dave Shreiner GLOBAL EDITION Interactive Computer Graphics A Top-Down Approach with WebGL SEVENTH EDITION Edward Angel Dave Shreiner This page is intentionall left blank. 4.10 Concatenation of Transformations 219 in

More information

What does OpenGL do?

What does OpenGL do? Theor behind Geometrical Transform What does OpenGL do? So the user specifies a lot of information Ee Center Up Near, far, UP EE Left, right top, bottom, etc. f b CENTER left right top bottom What does

More information

Two Dimensional Viewing

Two Dimensional Viewing Two Dimensional Viewing Dr. S.M. Malaek Assistant: M. Younesi Two Dimensional Viewing Basic Interactive Programming Basic Interactive Programming User controls contents, structure, and appearance of objects

More information

Projection: Mapping 3-D to 2-D. Orthographic Projection. The Canonical Camera Configuration. Perspective Projection

Projection: Mapping 3-D to 2-D. Orthographic Projection. The Canonical Camera Configuration. Perspective Projection Projection: Mapping 3-D to 2-D Our scene models are in 3-D space and images are 2-D so we need some wa of projecting 3-D to 2-D The fundamental approach: planar projection first, we define a plane in 3-D

More information

4. Two Dimensional Transformations

4. Two Dimensional Transformations 4. Two Dimensional Transformations CS362 Introduction to Computer Graphics Helena Wong, 2 In man applications, changes in orientations, sizes, and shapes are accomplished with geometric transformations

More information

CS 4731/543: Computer Graphics Lecture 5 (Part I): Projection. Emmanuel Agu

CS 4731/543: Computer Graphics Lecture 5 (Part I): Projection. Emmanuel Agu CS 4731/543: Computer Graphics Lecture 5 (Part I): Projection Emmanuel Agu 3D Viewing and View Volume Recall: 3D viewing set up Projection Transformation View volume can have different shapes (different

More information

3D graphics rendering pipeline (1) 3D graphics rendering pipeline (3) 3D graphics rendering pipeline (2) 8/29/11

3D graphics rendering pipeline (1) 3D graphics rendering pipeline (3) 3D graphics rendering pipeline (2) 8/29/11 3D graphics rendering pipeline (1) Geometr Rasteriation 3D Coordinates & Transformations Prof. Aaron Lanterman (Based on slides b Prof. Hsien-Hsin Sean Lee) School of Electrical and Computer Engineering

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

Viewing/Projections III. Week 4, Wed Jan 31

Viewing/Projections III. Week 4, Wed Jan 31 Universit of British Columbia CPSC 34 Computer Graphics Jan-Apr 27 Tamara Munner Viewing/Projections III Week 4, Wed Jan 3 http://www.ugrad.cs.ubc.ca/~cs34/vjan27 News etra TA coverage in lab to answer

More information

Realtime 3D Computer Graphics & Virtual Reality. Viewing

Realtime 3D Computer Graphics & Virtual Reality. Viewing Realtime 3D Computer Graphics & Virtual Realit Viewing Transformation Pol. Per Verte Pipeline CPU DL Piel Teture Raster Frag FB v e r t e object ee clip normalied device Modelview Matri Projection Matri

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

3D Coordinates & Transformations

3D Coordinates & Transformations 3D Coordinates & Transformations Prof. Aaron Lanterman (Based on slides b Prof. Hsien-Hsin Sean Lee) School of Electrical and Computer Engineering Georgia Institute of Technolog 3D graphics rendering pipeline

More information

Notes. University of British Columbia

Notes. University of British Columbia Notes Drop-bo is no. 14 You can hand in our assignments Assignment 0 due Fri. 4pm Assignment 1 is out Office hours toda 16:00 17:00, in lab or in reading room Uniersit of Uniersit of Chapter 4 - Reminder

More information

Transformations II. Arbitrary 3D Rotation. What is its inverse? What is its transpose? Can we constructively elucidate this relationship?

Transformations II. Arbitrary 3D Rotation. What is its inverse? What is its transpose? Can we constructively elucidate this relationship? Utah School of Computing Fall 25 Transformations II CS46 Computer Graphics From Rich Riesenfeld Fall 25 Arbitrar 3D Rotation What is its inverse? What is its transpose? Can we constructivel elucidate this

More information

Computer Graphics. Geometric Transformations

Computer Graphics. Geometric Transformations Contents coordinate sstems scalar values, points, vectors, matrices right-handed and left-handed coordinate sstems mathematical foundations transformations mathematical descriptions of geometric changes,

More information

Illumination & Shading I

Illumination & Shading I CS 543: Computer Graphics Illumination & Shading I Robert W. Lindeman Associate Professor Interactive Media & Game Development Department of Computer Science Worcester Polytechnic Institute gogo@wpi.edu

More information

Computer Graphics. Geometric Transformations

Computer Graphics. Geometric Transformations Computer Graphics Geometric Transformations Contents coordinate sstems scalar values, points, vectors, matrices right-handed and left-handed coordinate sstems mathematical foundations transformations mathematical

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

1/29/13. Computer Graphics. Transformations. Simple Transformations

1/29/13. Computer Graphics. Transformations. Simple Transformations /29/3 Computer Graphics Transformations Simple Transformations /29/3 Contet 3D Coordinate Sstems Right hand (or counterclockwise) coordinate sstem Left hand coordinate sstem Not used in this class and

More information

3-Dimensional Viewing

3-Dimensional Viewing CHAPTER 6 3-Dimensional Vieing Vieing and projection Objects in orld coordinates are projected on to the vie plane, hich is defined perpendicular to the vieing direction along the v -ais. The to main tpes

More information

CS Computer Graphics: Illumination and Shading I

CS Computer Graphics: Illumination and Shading I CS 543 - Computer Graphics: Illumination and Shading I by Robert W. Lindeman gogo@wpi.edu (with help from Emmanuel Agu ;-) Illumination and Shading Problem: Model light/surface point interactions to determine

More information

CS Computer Graphics: Illumination and Shading I

CS Computer Graphics: Illumination and Shading I CS 543 - Computer Graphics: Illumination and Shading I by Robert W. Lindeman gogo@wpi.edu (with help from Emmanuel Agu ;-) Illumination and Shading Problem: Model light/surface point interactions to determine

More information

CPSC 314, Midterm Exam. 8 March 2010

CPSC 314, Midterm Exam. 8 March 2010 CPSC, Midterm Eam 8 March 00 Closed book, no electronic devices besides (simple, nongraphing) calculators. Cell phones must be turned off. Place our photo ID face up on our desk. One single-sided sheet

More information

Transformations II. Week 2, Wed Jan 17

Transformations II. Week 2, Wed Jan 17 Universit of British Columbia CPSC 34 Computer Graphics Jan-Apr 27 Tamara Munzner Transformations II Week 2, Wed Jan 7 http://www.ugrad.cs.ubc.ca/~cs34/vjan27 Readings for Jan 5-22 FCG Chap 6 Transformation

More information

Modeling Transformations Revisited

Modeling Transformations Revisited Modeling Transformations Revisited Basic 3D Transformations Translation Scale Shear Rotation 3D Transformations Same idea as 2D transformations o Homogeneous coordinates: (,,z,w) o 44 transformation matrices

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

One or more objects A viewer with a projection surface Projectors that go from the object(s) to the projection surface

One or more objects A viewer with a projection surface Projectors that go from the object(s) to the projection surface Classical Viewing Viewing requires three basic elements One or more objects A viewer with a projection surface Projectors that go from the object(s) to the projection surface Classical views are based

More information

Today s class. Geometric objects and transformations. Informationsteknologi. Wednesday, November 7, 2007 Computer Graphics - Class 5 1

Today s class. Geometric objects and transformations. Informationsteknologi. Wednesday, November 7, 2007 Computer Graphics - Class 5 1 Toda s class Geometric objects and transformations Wednesda, November 7, 27 Computer Graphics - Class 5 Vector operations Review of vector operations needed for working in computer graphics adding two

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

CS 428: Fall Introduction to. Viewing and projective transformations. Andrew Nealen, Rutgers, /23/2009 1

CS 428: Fall Introduction to. Viewing and projective transformations. Andrew Nealen, Rutgers, /23/2009 1 CS 428: Fall 29 Introduction to Computer Graphics Viewing and projective transformations Andrew Nealen, Rutgers, 29 9/23/29 Modeling and viewing transformations Canonical viewing volume Viewport transformation

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

Classical and Computer Viewing. Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico

Classical and Computer Viewing. Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico Classical and Computer Viewing Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico Planar Geometric Projections Standard projections project onto a plane Projectors

More information

What and Why Transformations?

What and Why Transformations? 2D transformations What and Wh Transformations? What? : The geometrical changes of an object from a current state to modified state. Changing an object s position (translation), orientation (rotation)

More information

Lecture 4: Viewing. Topics:

Lecture 4: Viewing. Topics: Lecture 4: Viewing Topics: 1. Classical viewing 2. Positioning the camera 3. Perspective and orthogonal projections 4. Perspective and orthogonal projections in OpenGL 5. Perspective and orthogonal projection

More information

CS 4204 Computer Graphics

CS 4204 Computer Graphics CS 4204 Computer Graphics 3D Viewing and Projection Yong Cao Virginia Tech Objective We will develop methods to camera through scenes. We will develop mathematical tools to handle perspective projection.

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

High Dimensional Rendering in OpenGL

High Dimensional Rendering in OpenGL High Dimensional Rendering in OpenGL Josh McCo December, 2003 Description of Project Adding high dimensional rendering capabilit to the OpenGL graphics programming environment is the goal of this project

More information

CS559: Computer Graphics

CS559: Computer Graphics CS559: Computer Graphics Lecture 8: 3D Transforms Li Zhang Spring 28 Most Slides from Stephen Chenne Finish Color space Toda 3D Transforms and Coordinate sstem Reading: Shirle ch 6 RGB and HSV Green(,,)

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

Scene Graphs & Modeling Transformations COS 426

Scene Graphs & Modeling Transformations COS 426 Scene Graphs & Modeling Transformations COS 426 3D Object Representations Points Range image Point cloud Surfaces Polgonal mesh Subdivision Parametric Implicit Solids Voels BSP tree CSG Sweep High-level

More information

CS770/870 Spring 2017 Transformations

CS770/870 Spring 2017 Transformations CS770/870 Spring 2017 Transformations Coordinate sstems 2D Transformations Homogeneous coordinates Matrices, vectors, points Coordinate Sstems Coordinate sstems used in graphics Screen coordinates: the

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

CPSC 314, Midterm Exam. 8 March 2013

CPSC 314, Midterm Exam. 8 March 2013 CPSC, Midterm Eam 8 March 0 Closed book, no electronic devices besides simple calculators. Cell phones must be turned off. Place our photo ID face up on our desk. One single-sided sheet of handwritten

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

Image Warping : Computational Photography Alexei Efros, CMU, Fall Some slides from Steve Seitz

Image Warping : Computational Photography Alexei Efros, CMU, Fall Some slides from Steve Seitz Image Warping http://www.jeffre-martin.com Some slides from Steve Seitz 5-463: Computational Photograph Aleei Efros, CMU, Fall 2 Image Transformations image filtering: change range of image g() T(f())

More information

Image Warping. Some slides from Steve Seitz

Image Warping.   Some slides from Steve Seitz Image Warping http://www.jeffre-martin.com Some slides from Steve Seitz 5-463: Computational Photograph Aleei Efros, CMU, Fall 26 Image Warping image filtering: change range of image g() T(f()) f T f image

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

Interactive Computer Graphics. Warping and morphing. Warping and Morphing. Warping and Morphing. Lecture 14+15: Warping and Morphing. What is.

Interactive Computer Graphics. Warping and morphing. Warping and Morphing. Warping and Morphing. Lecture 14+15: Warping and Morphing. What is. Interactive Computer Graphics Warping and morphing Lecture 14+15: Warping and Morphing Lecture 14: Warping and Morphing: Slide 1 Lecture 14: Warping and Morphing: Slide 2 Warping and Morphing What is Warping

More information

p =(x,y,d) y (0,0) d z Projection plane, z=d

p =(x,y,d) y (0,0) d z Projection plane, z=d Projections ffl Mapping from d dimensional space to d 1 dimensional subspace ffl Range of an projection P : R! R called a projection plane ffl P maps lines to points ffl The image of an point p under P

More information

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

5.8.3 Oblique Projections

5.8.3 Oblique Projections 278 Chapter 5 Viewing y (, y, ) ( p, y p, p ) Figure 537 Oblique projection P = 2 left right 0 0 left+right left right 0 2 top bottom 0 top+bottom top bottom far+near far near 0 0 far near 2 0 0 0 1 Because

More information

Editing and Transformation

Editing and Transformation Lecture 5 Editing and Transformation Modeling Model can be produced b the combination of entities that have been edited. D: circle, arc, line, ellipse 3D: primitive bodies, etrusion and revolved of a profile

More information

Viewing. Cliff Lindsay, Ph.D. WPI

Viewing. Cliff Lindsay, Ph.D. WPI Viewing Cliff Lindsa, Ph.D. WPI Building Virtual Camera Pipeline l Used To View Virtual Scene l First Half of Rendering Pipeline Related To Camera l Takes Geometr From ApplicaHon To RasteriaHon Stages

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

To Do. Demo (Projection Tutorial) Motivation. What we ve seen so far. Outline. Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 5: Viewing

To Do. Demo (Projection Tutorial) Motivation. What we ve seen so far. Outline. Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 5: Viewing Foundations of Computer Graphics (Fall 0) CS 84, Lecture 5: Viewing http://inst.eecs.berkele.edu/~cs84 To Do Questions/concerns about assignment? Remember it is due Sep. Ask me or TAs re problems Motivation

More information

3D Geometry and Camera Calibration

3D Geometry and Camera Calibration 3D Geometr and Camera Calibration 3D Coordinate Sstems Right-handed vs. left-handed 2D Coordinate Sstems ais up vs. ais down Origin at center vs. corner Will often write (u, v) for image coordinates v

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

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

Computer Viewing. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science Computer Viewing CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science 1 Objectives Introduce the mathematics of projection Introduce OpenGL viewing functions Look at

More information

Name: [20 points] Consider the following OpenGL commands:

Name: [20 points] Consider the following OpenGL commands: Name: 2 1. [20 points] Consider the following OpenGL commands: glmatrimode(gl MODELVIEW); glloadidentit(); glrotatef( 90.0, 0.0, 1.0, 0.0 ); gltranslatef( 2.0, 0.0, 0.0 ); glscalef( 2.0, 1.0, 1.0 ); What

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

Chap 7, 2009 Spring Yeong Gil Shin

Chap 7, 2009 Spring Yeong Gil Shin Three-Dimensional i Viewingi Chap 7, 29 Spring Yeong Gil Shin Viewing i Pipeline H d fi i d? How to define a window? How to project onto the window? Rendering "Create a picture (in a snthetic camera) Specification

More information

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

Fall CSCI 420: Computer Graphics. 2.2 Transformations. Hao Li. Fall 2017 CSCI 420: Computer Graphics 2.2 Transformations Hao Li http://cs420.hao-li.com 1 OpenGL Transformations Matrices Model-view matrix (4x4 matrix) Projection matrix (4x4 matrix) vertices in 3D Model-view

More information

Homogeneous Coordinates

Homogeneous Coordinates COMS W4172 3D Math 2 Steven Feiner Department of Computer Science Columbia Universit New York, NY 127 www.cs.columbia.edu/graphics/courses/csw4172 Februar 1, 218 1 Homogeneous Coordinates w X W Y X W Y

More information

CSE328 Fundamentals of Computer Graphics: Theory, Algorithms, and Applications

CSE328 Fundamentals of Computer Graphics: Theory, Algorithms, and Applications CSE328 Fundamentals of Computer Graphics: Theor, Algorithms, and Applications Hong in State Universit of New York at Ston Brook (Ston Brook Universit) Ston Brook, New York 794-44 Tel: (63)632-845; Fa:

More information

Modeling Transformations

Modeling Transformations Modeling Transformations Michael Kazhdan (601.457/657) HB Ch. 5 FvDFH Ch. 5 Overview Ra-Tracing so far Modeling transformations Ra Tracing Image RaTrace(Camera camera, Scene scene, int width, int heigh,

More information

GRAFIKA KOMPUTER. ~ M. Ali Fauzi

GRAFIKA KOMPUTER. ~ M. Ali Fauzi GRAFIKA KOMPUTER ~ M. Ali Fauzi Drawing 2D Graphics VIEWPORT TRANSFORMATION Recall :Coordinate System glutreshapefunc(reshape); void reshape(int w, int h) { glviewport(0,0,(glsizei) w, (GLsizei) h); glmatrixmode(gl_projection);

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

Computer Graphics. P04 Transformations. Aleksandra Pizurica Ghent University

Computer Graphics. P04 Transformations. Aleksandra Pizurica Ghent University Computer Graphics P4 Transformations Aleksandra Pizurica Ghent Universit Telecommunications and Information Processing Image Processing and Interpretation Group Transformations in computer graphics Goal:

More information

Last Time. Correct Transparent Shadow. Does Ray Tracing Simulate Physics? Does Ray Tracing Simulate Physics? Refraction and the Lifeguard Problem

Last Time. Correct Transparent Shadow. Does Ray Tracing Simulate Physics? Does Ray Tracing Simulate Physics? Refraction and the Lifeguard Problem Graphics Pipeline: Projective Last Time Shadows cast ra to light stop after first intersection Reflection & Refraction compute direction of recursive ra Recursive Ra Tracing maimum number of bounces OR

More information

CS F-07 Objects in 2D 1

CS F-07 Objects in 2D 1 CS420-2010F-07 Objects in 2D 1 07-0: Representing Polgons We want to represent a simple polgon Triangle, rectangle, square, etc Assume for the moment our game onl uses these simple shapes No curves for

More information

Motivation. What we ve seen so far. Demo (Projection Tutorial) Outline. Projections. Foundations of Computer Graphics

Motivation. What we ve seen so far. Demo (Projection Tutorial) Outline. Projections. Foundations of Computer Graphics Foundations of Computer Graphics Online Lecture 5: Viewing Orthographic Projection Ravi Ramamoorthi Motivation We have seen transforms (between coord sstems) But all that is in 3D We still need to make

More information

Geometric Transformations

Geometric Transformations CS INTRODUCTION TO COMPUTER GRAPHICS Geometric Transformations D and D Andries an Dam 9/9/7 /46 CS INTRODUCTION TO COMPUTER GRAPHICS How do we use Geometric Transformations? (/) Objects in a scene at the

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

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

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

To Do. Motivation. Demo (Projection Tutorial) What we ve seen so far. Computer Graphics. Summary: The Whole Viewing Pipeline

To Do. Motivation. Demo (Projection Tutorial) What we ve seen so far. Computer Graphics. Summary: The Whole Viewing Pipeline Computer Graphics CSE 67 [Win 9], Lecture 5: Viewing Ravi Ramamoorthi http://viscomp.ucsd.edu/classes/cse67/wi9 To Do Questions/concerns about assignment? Remember it is due tomorrow! (Jan 6). Ask me or

More information

The 3-D Graphics Rendering Pipeline

The 3-D Graphics Rendering Pipeline The 3-D Graphics Rendering Pipeline Modeling Trival Rejection Illumination Viewing Clipping Projection Almost ever discussion of 3-D graphics begins here Seldom are an two versions drawn the same wa Seldom

More information

CS Computer Graphics: Introduction to Ray Tracing

CS Computer Graphics: Introduction to Ray Tracing CS 543 - Computer Graphics: Introduction to Ray Tracing by Robert W. Lindeman gogo@wpi.edu (with help from Peter Lohrmann ;-) View Volume View volume similar to gluperspective Angle Aspect Near? Far? But

More information

CS Computer Graphics: Introduction to Ray Tracing

CS Computer Graphics: Introduction to Ray Tracing CS 543 - Computer Graphics: Introduction to Ray Tracing by Robert W. Lindeman gogo@wpi.edu (with help from Peter Lohrmann ;-) View Volume View volume similar to gluperspective Angle Aspect Near? Far? But

More information

Transformations. Examples of transformations: shear. scaling

Transformations. Examples of transformations: shear. scaling Transformations Eamples of transformations: translation rotation scaling shear Transformations More eamples: reflection with respect to the y-ais reflection with respect to the origin Transformations Linear

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

Viewing. Announcements. A Note About Transformations. Orthographic and Perspective Projection Implementation Vanishing Points

Viewing. Announcements. A Note About Transformations. Orthographic and Perspective Projection Implementation Vanishing Points Viewing Announcements. A Note About Transformations. Orthographic and Perspective Projection Implementation Vanishing Points Viewing Announcements. A Note About Transformations. Orthographic and Perspective

More information

Transformations III. Week 2, Fri Jan 19

Transformations III. Week 2, Fri Jan 19 Universit of British Columbia CPSC 34 Computer Graphics Jan-Apr 2007 Tamara Munzner Transformations III Week 2, Fri Jan 9 http://www.ugrad.cs.ubc.ca/~cs34/vjan2007 Readings for Jan 5-22 FCG Chap 6 Transformation

More information

2D Image Transforms Computer Vision (Kris Kitani) Carnegie Mellon University

2D Image Transforms Computer Vision (Kris Kitani) Carnegie Mellon University 2D Image Transforms 16-385 Computer Vision (Kris Kitani) Carnegie Mellon University Extract features from an image what do we do next? Feature matching (object recognition, 3D reconstruction, augmented

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. Transformation

Computer Graphics. Transformation (SBE 36) Dr. Aman Eldeib Spring 2 SBE 36 i a fundamental corner tone of computer graphic and i a central to OpenGL a well a mot other graphic tem.(2d and 3D ) Given an object, tranformation i to change

More information

Evening s Goals. Mathematical Transformations. Discuss the mathematical transformations that are utilized for computer graphics

Evening s Goals. Mathematical Transformations. Discuss the mathematical transformations that are utilized for computer graphics Evening s Goals Discuss the mathematical transformations that are utilized for computer graphics projection viewing modeling Describe aspect ratio and its importance Provide a motivation for homogenous

More information

Institutionen för systemteknik

Institutionen för systemteknik Code: Day: Lokal: M7002E 19 March E1026 Institutionen för systemteknik Examination in: M7002E, Computer Graphics and Virtual Environments Number of sections: 7 Max. score: 100 (normally 60 is required

More information

Viewing and Modeling

Viewing and Modeling Viewing and Modeling Computer Science Department The Universit of Texas at Austin A Simplified Graphics ipeline Application Vertex batching & assembl Triangle assembl Triangle clipping NDC to window space

More information