CSC 305 The Graphics Pipeline-1

Size: px
Start display at page:

Download "CSC 305 The Graphics Pipeline-1"

Transcription

1 C. O. P. d y! "#"" (-1, -1) (1, 1) x z CSC 305 The Graphics Pipeline-1 by Brian Wyvill The University of Victoria Graphics Group

2 Perspective Viewing Transformation l l l Tools for creating and manipulating a camera that produces pictures of a 3D scene Viewing transformations and projections Perform culling or back-face elimination University of Victoria Graphics Lab. CSC page 2

3 The Illusion of Depth Perception is an active organising process Many cues to depth! University of Victoria Graphics Lab. CSC page 3

4 Window to Viewport Transformation University of Victoria Graphics Lab. CSC page 4

5 University of Victoria Graphics Lab. CSC page 5

6 Viewing Transformations Sequence that takes a model from object space to the viewport (window) Shirley: Chapter 7. University of Victoria Graphics Lab. CSC page 6

7 Pixel Conventions Rectangular domain of the image: R = [ 0.5,n x 0.5]x[ 0.5,n y 0.5] University of Victoria Graphics Lab. CSC page 7

8 Canonical View Volume (chapter 7 Shirley see also chapter 5 on matrices) y z x Object to map lines in the canonical view volume to the screen. (x,y,z) in [-1, 1] 3 (as in interval [a,b]) For now assume that all line segments are in the view volume (clipping later!) The camera views the canonical view volume looking along the z axis University of Victoria Graphics Lab. CSC page 8

9 Mapping to the screen (ignore z distance along projection axis not affect x,y) Pixel Geometry (-½, ½) (½, ½) (-½, -½) y (0,0) (½, -½) -x z (-1, -1) Map lines to Screen along the Z axis in (+)ve direction. 2 Screen n x by n y pixels x = -1 à left side of screen x = +1 à right side of screen y = -1 à bottom of screen y = +1 à top of screen Maps square [-1, +1] 2 to non-square scales S x and S y will be defined. (1, 1) 2 (-½, n y -½) (-½, -½) Screen Geometry n x (n x -½, n y -½) n y (n x -½, -½) University of Victoria Graphics Lab. CSC page 9

10 As Before a Window to Viewport Transform (-1, -1) Canonical Canonical Map lines to Screen along the Z axis in (+)ve direction. 2 (1, 1) 2 (-½, n y -½) (-½, -½) Pixels Screen Geometry n x (n x -½, n y -½) n y (n x -½, -½) [ 1 x pixel ] y pixel = [ nx/2 0 (nx-1)/2 0 n y /2 (n y -1)/ ] [ x caonical ] y canonical 1 For now simply ignore The z-values distorts by aspect ratio - Note that M vp is the above plus a line for z University of Victoria Graphics Lab. CSC page 10

11 Mvp Window to Viewport Matrix 4x4 to preserve z [ 1 x pixel ] y pixel = [ nx/2 0 (nx-1)/2 0 n y /2 (n y -1)/ ] [ x caonical ] y canonical 1 " M vp = # n x n 0 0 x n y n 0 y % & University of Victoria Graphics Lab. CSC page 11

12 Orthographic View Volume (fixed axis view) Right Handed System Gaze (or camera view) along Z direction ( note n > f less negative) x to the right and y up The transform we want is just a scale and translate. It takes: transforms to transforms to y = b à y = -1, y = t à y = +1 x = l à x = -1, x = r à x = +1 z = n à z = 1, z = f à z = -1 University of Victoria Graphics Lab. CSC page 12

13 Orthographic Projection What happens if we don t have a canonical view volume? (l,b,n) a b (r,t,f) (l,b,n) = (lower, bottom, near) (r,t,f)= (right, top, front) Left plane à xà Right Plane Bottom plane à yà Top Plane Near plane à zà Far Plane Find matrix M s.t. M.a and M.b are in canonical view volume. e.g lines in Orthographic view volume above Bounded by axis aligned planes M orth M orth transforms from Orthographic View volume to canonical " M orth = # 2 r l r + l r l 2 0 t + b t b t b 2 n + f n f n f % & University of Victoria Graphics Lab. CSC page 13

14 Window to Viewport Transform Revisited: , u v min min 1 * ( ( ( ) , λ 0 0 x 0 λ 0 y 0* ( 0 ( 1( ) , x y 1 min min * ( ( ( ) -x* + y ( + ( +, 1( ) where M 0 = u x n x /2 0 0 (n λ x -1)/2 % max 0 n = x y /2 0 (n % y -1)/2 & max 0, u x 2/(r-l) 0 0 v 0 min " max 0, 2/(t-b) = " λ x 0 0 y min # 0 0 2/(n-f) max 0 v y (l+r)/2 min (b+t)/2 min (n+f)/ M 0 =M vp M orth is just Another Window to Viewport Transform University of Victoria Graphics Lab. CSC page 14

15 Scale then translate The transform from the orthographic view volume to the canonical view volume. n is less (-)ve than f x canonical 2/(r-l) (l+r)/2 x y canonical z canonical 1 = 0 2/(t-b) /(n-f) (b+t)/ (n+f)/ y z 1 The earlier transform took canonical coords and put them on the Screen. Combining that with the above: 2/(r-l) 0 0 -(l+r)/2 0 2/(t-b) 0 -(b+t)/2 M orth = 0 0 2/(n-f) -(n+f)/ University of Victoria Graphics Lab. CSC page 15

16 Orthographic Projection: Now we can find pixel coordinates from some user defined view volume coordinates: projection transform 2/(r-l) 0 0 -(l+r)/2 0 2/(t-b) 0 -(b+t)/2 M orth = 0 0 2/(n-f) -(n+f)/ = M vp viewport transform n x /2 0 0 (n x -1)/2 0 n y /2 0 (n y -1)/ x pixel y pixel z canonical 1 = M 0 M vp M orth x y z 1 Note that z will be in [-1,1] useful later for z-buffer University of Victoria Graphics Lab. CSC page 16

17 Orthographic Projection Algorithm compute M vp compute M orth M=M 0 =M vp M orth for each line segment in 3D (a i, b i ) do { p = Ma i q = Mb i drawline(x p, y p, x q, y q ) } University of Victoria Graphics Lab. CSC page 17

18 Arbitrary View Positions e = Eye Position g = gaze direction t = view up vector W V t Derive a coordinate system with origin e and uvw basis W= U= - g g t x W t x W U e g V= W x U View up vector points to the sky! Bi-sects the viewers head as in photography. University of Victoria Graphics Lab. CSC page 18

19 Arbitrary View Positions View volume coordinates: origin o and xyz axes. need to convert these to origin e and uvw axes. We can use:! # M vrot = # # # " u x u y u z v x v y v z w x w y w z & & & & % " M v = M vrot # x e y e z e % & University of Victoria Graphics Lab. CSC page 19

20 Why is Mv computed this way?! # M vrot = # # # " u x u y u z v x v y v z w x w y w z & & & & % Orthogonal Matrix Properties upper 3x3 rotates row vectors into the major axes applies to any rotation matrix or rotation translation (+normalization). cosθ -sinθ 0 sinθ cosθ cosθ -sin 0 = University of Victoria Graphics Lab. CSC page 20

21 University of Victoria Graphics Lab. CSC page 21

22 University of Victoria Graphics Lab. CSC page 22

23 University of Victoria Graphics Lab. CSC page 23

24 Rodrigues Forumula If v is a vector in R 3 and k is a unit vector describing an axis of rotation about which v rotates by an angle θ according to the right hand rule, the Rodrigues formula is : v rot = vcosθ + (k v)sinθ + k(k v)(1 cosθ) University of Victoria Graphics Lab. CSC page 24

25 Example v y w u z x eye (6, 7.5, 8 ) vup t(0, 1, 0) atpt (0, 0, 0) gaze g= (0,0,0) (6,7.5,8) sqrt(6*6+7.5*7.5+8*8) = 12.5 w = -g/ g = (6/12.5, 7.5/12.5, 8/12.5 )=(0.48, 0.6, 0.64) u=(t x w)/ t x W v=(w x u) University of Victoria Graphics Lab. CSC page 25

26 Calculate U-vector w= 1/12.5 (6, 7.5, 8) t =(0, 1, 0) u=(t x w)/ t x w = (1/12.5)det i j k t x w = 1/12.5 ( 8, -0.0, -6.0)= (0.6, 0.0, -0.48) t x w t x w 1/12.5 ( 8, -0.0, -6.0) = = ( 0.8, 0.0, -0.6) 1/12.5 * sqrt(64+36) University of Victoria Graphics Lab. CSC page 26

27 Calculate V-vector v = w x u w = 1/12.5 (6, 7.5, 8) u = ( 0.8, 0.0, -0.6) (1/12.5* 1/12.5) det i j k v = 1/(12.5 *12.5)( , 35, -75) v = 1/12.5(-4.5, 10, -6) v = (-0.36, 0.8, -0.48) University of Victoria Graphics Lab. CSC page 27

28 Calculate M vrot " M vrot = #! # M vrot = # # # " M % & u x u y u z v x v y v z w x w y w z & & & & % for eye at ( 6, 7.5, 8 ) Add last column and row For homogeneous coords check the matrix: = similarly 2 nd row into y-axis 3 rd row into z-axis University of Victoria Graphics Lab. CSC page 28

29 Orthographic Projection Algorithm Arbitrary View Point compute M v compute M 0 " M v = M vrot # M = M 0 M v for each line segment in 3D (a i, b i ) do { p = Ma i q = Mb i drawline(x p, y p, x q, y q ) } x e y e z e % & University of Victoria Graphics Lab. CSC page 29

30 3 Point Perspective Objective is to simulate this method University of Victoria Graphics Lab. CSC page 30

31 v u -w University of Victoria Graphics Lab. CSC page 31

32 Geometry for the View Volume v (0.5,0.5) up u w ( n + 0.5, n + 0.5) x y University of Victoria Graphics Lab. CSC page 32

33 True Perspective in 2D size of an object proportional to 1/z y s = (d/z) y y (x,y) g!!#!!! " d! #! " y s View Plane x University of Victoria Graphics Lab. CSC page 33

34 University of Victoria Graphics Lab. CSC page 34

35 Perspective View Transformation n f n f The view frustrum is an inconvenient shape. Clipping Z depth calculation Hidden surface calculation University of Victoria Graphics Lab. CSC page 35

36 Perspective View Transformation We want to find a matrix that 1. does not change points on z=n plane n f 2. maps large rectangle at z=f to small rectangle at z=n 3. achieve division by z by using homogeneous to cartesian conversion i.e. homogenize University of Victoria Graphics Lab. CSC page 36

37 Perspective Matrix M p = M p n+f n -f n 0 for homogenous point (x,y,z,1) = (x/h, y/h, z/h, h) " x% y z # 1& = " x y z n + f n z # n f % & Transforms lines to lines and planes to planes. Line segments in the view volume are transformed to line segments in the canonical view volume. hom ogenize(/ w) )))) z w = n " # nx z ny z n + f nf z 1 % & University of Victoria Graphics Lab. CSC page 37

38 Perspective Projection Algorithm We can now use the mechanism we used before for orthographic projection Again Arbitrary View Point compute M v compute M 0 compute M p M=M 0 M v M p for each line segment in 3D (a i, b i ) do { p = Ma i } q = Mb i x p, y p drawline(, x q, y q h h h h ) University of Victoria Graphics Lab. CSC page 38

39 Z-behavior as a result of Perspective Projection Matrix z s = n + f fn/z n=10 f=100 Points (lines and planes) outside viewing volume should be clipped. z s Fewer bits of resolution are available to compare z values far from the eye. Z-buffer does linear interpolation in Z. z University of Victoria Graphics Lab. CSC page 39

3D Viewing. CS 4620 Lecture 8

3D Viewing. CS 4620 Lecture 8 3D Viewing CS 46 Lecture 8 13 Steve Marschner 1 Viewing, backward and forward So far have used the backward approach to viewing start from pixel ask what part of scene projects to pixel explicitly construct

More information

CSE528 Computer Graphics: Theory, Algorithms, and Applications

CSE528 Computer Graphics: Theory, Algorithms, and Applications CSE528 Computer Graphics: Theory, Algorithms, and Applications Hong Qin Stony Brook University (SUNY at Stony Brook) Stony Brook, New York 11794-2424 Tel: (631)632-845; Fax: (631)632-8334 qin@cs.stonybrook.edu

More information

CSE328 Fundamentals of Computer Graphics

CSE328 Fundamentals of Computer Graphics CSE328 Fundamentals of Computer Graphics Hong Qin State University of New York at Stony Brook (Stony Brook University) Stony Brook, New York 794--44 Tel: (63)632-845; Fax: (63)632-8334 qin@cs.sunysb.edu

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

3D Viewing. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 9

3D Viewing. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 9 3D Viewing CS 46 Lecture 9 Cornell CS46 Spring 18 Lecture 9 18 Steve Marschner 1 Viewing, backward and forward So far have used the backward approach to viewing start from pixel ask what part of scene

More information

Computer Graphics. Lecture 04 3D Projection and Visualization. Edirlei Soares de Lima.

Computer Graphics. Lecture 04 3D Projection and Visualization. Edirlei Soares de Lima. Computer Graphics Lecture 4 3D Projection and Visualization Edirlei Soares de Lima Projection and Visualization An important use of geometric transformations in computer

More information

Graphics 2009/2010, period 1. Lecture 6: perspective projection

Graphics 2009/2010, period 1. Lecture 6: perspective projection Graphics 2009/2010, period 1 Lecture 6 Perspective projection Orthographic vs. perspective projection Introduction Projecting from arbitrary camera positions Orthographic projection and the canonical view

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

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

Game Architecture. 2/19/16: Rasterization

Game Architecture. 2/19/16: Rasterization Game Architecture 2/19/16: Rasterization Viewing To render a scene, need to know Where am I and What am I looking at The view transform is the matrix that does this Maps a standard view space into world

More information

Chap 3 Viewing Pipeline Reading: Angel s Interactive Computer Graphics, Sixth ed. Sections 4.1~4.7

Chap 3 Viewing Pipeline Reading: Angel s Interactive Computer Graphics, Sixth ed. Sections 4.1~4.7 Chap 3 Viewing Pipeline Reading: Angel s Interactive Computer Graphics, Sixth ed. Sections 4.~4.7 Chap 3 View Pipeline, Comp. Graphics (U) CGGM Lab., CS Dept., NCTU Jung Hong Chuang Outline View parameters

More information

09 - Designing Surfaces. CSCI-GA Computer Graphics - Fall 16 - Daniele Panozzo

09 - Designing Surfaces. CSCI-GA Computer Graphics - Fall 16 - Daniele Panozzo 9 - Designing Surfaces Triangular surfaces A surface can be discretized by a collection of points and triangles Each triangle is a subset of a plane Every point on the surface can be expressed as an affine

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

INTRODUCTION TO COMPUTER GRAPHICS. It looks like a matrix Sort of. Viewing III. Projection in Practice. Bin Sheng 10/11/ / 52

INTRODUCTION TO COMPUTER GRAPHICS. It looks like a matrix Sort of. Viewing III. Projection in Practice. Bin Sheng 10/11/ / 52 cs337 It looks like a matrix Sort of Viewing III Projection in Practice / 52 cs337 Arbitrary 3D views Now that we have familiarity with terms we can say that these view volumes/frusta can be specified

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

The Graphics Pipeline and OpenGL I: Transformations!

The Graphics Pipeline and OpenGL I: Transformations! ! The Graphics Pipeline and OpenGL I: Transformations! Gordon Wetzstein! Stanford University! EE 267 Virtual Reality! Lecture 2! stanford.edu/class/ee267/!! Albrecht Dürer, Underweysung der Messung mit

More information

Viewing COMPSCI 464. Image Credits: Encarta and

Viewing COMPSCI 464. Image Credits: Encarta and Viewing COMPSCI 464 Image Credits: Encarta and http://www.sackville.ednet.ns.ca/art/grade/drawing/perspective4.html Graphics Pipeline Graphics hardware employs a sequence of coordinate systems The location

More information

INTRODUCTION TO COMPUTER GRAPHICS. cs123. It looks like a matrix Sort of. Viewing III. Projection in Practice 1 / 52

INTRODUCTION TO COMPUTER GRAPHICS. cs123. It looks like a matrix Sort of. Viewing III. Projection in Practice 1 / 52 It looks like a matrix Sort of Viewing III Projection in Practice 1 / 52 Arbitrary 3D views } view volumes/frusta spec d by placement and shape } Placement: } Position (a point) } look and up vectors }

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

UNIT 2 2D TRANSFORMATIONS

UNIT 2 2D TRANSFORMATIONS UNIT 2 2D TRANSFORMATIONS Introduction With the procedures for displaying output primitives and their attributes, we can create variety of pictures and graphs. In many applications, there is also a need

More information

Three-Dimensional Viewing Hearn & Baker Chapter 7

Three-Dimensional Viewing Hearn & Baker Chapter 7 Three-Dimensional Viewing Hearn & Baker Chapter 7 Overview 3D viewing involves some tasks that are not present in 2D viewing: Projection, Visibility checks, Lighting effects, etc. Overview First, set up

More information

Models and The Viewing Pipeline. Jian Huang CS456

Models and The Viewing Pipeline. Jian Huang CS456 Models and The Viewing Pipeline Jian Huang CS456 Vertex coordinates list, polygon table and (maybe) edge table Auxiliary: Per vertex normal Neighborhood information, arranged with regard to vertices and

More information

Lecture 5: Transforms II. Computer Graphics and Imaging UC Berkeley CS184/284A

Lecture 5: Transforms II. Computer Graphics and Imaging UC Berkeley CS184/284A Lecture 5: Transforms II Computer Graphics and Imaging UC Berkeley 3D Transforms 3D Transformations Use homogeneous coordinates again: 3D point = (x, y, z, 1) T 3D vector = (x, y, z, 0) T Use 4 4 matrices

More information

Introduction to Computer Graphics 4. Viewing in 3D

Introduction to Computer Graphics 4. Viewing in 3D Introduction to Computer Graphics 4. Viewing in 3D National Chiao Tung Univ, Taiwan By: I-Chen Lin, Assistant Professor Textbook: E.Angel, Interactive Computer Graphics, 5 th Ed., Addison Wesley Ref: Hearn

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

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

3D Geometry and Camera Calibration

3D Geometry and Camera Calibration 3D Geometry and Camera Calibration 3D Coordinate Systems Right-handed vs. left-handed x x y z z y 2D Coordinate Systems 3D Geometry Basics y axis up vs. y axis down Origin at center vs. corner Will often

More information

Computer Science 426 Midterm 3/11/04, 1:30PM-2:50PM

Computer Science 426 Midterm 3/11/04, 1:30PM-2:50PM NAME: Login name: Computer Science 46 Midterm 3//4, :3PM-:5PM This test is 5 questions, of equal weight. Do all of your work on these pages (use the back for scratch space), giving the answer in the space

More information

Specifying Complex Scenes

Specifying Complex Scenes Transformations Specifying Complex Scenes (x,y,z) (r x,r y,r z ) 2 (,,) Specifying Complex Scenes Absolute position is not very natural Need a way to describe relative relationship: The lego is on top

More information

Virtual Cameras and The Transformation Pipeline

Virtual Cameras and The Transformation Pipeline Virtual Cameras and The Transformation Pipeline Anton Gerdelan gerdela@scss.tcd.ie with content from Rachel McDonnell 13 Oct 2014 Virtual Camera We want to navigate through our scene in 3d Solution = create

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

Chapter 5. Projections and Rendering

Chapter 5. Projections and Rendering Chapter 5 Projections and Rendering Topics: Perspective Projections The rendering pipeline In order to view manipulate and view a graphics object we must find ways of storing it a computer-compatible way.

More information

Implementing a virtual camera. Graphics 2. Creating a view of the scene an outline. Virtual camera - definitions

Implementing a virtual camera. Graphics 2. Creating a view of the scene an outline. Virtual camera - definitions Graphics 2 Implementing a virtual camera 06-02408 Level 3 10 credits in Semester 2 Professor Aleš Leonardis Defining a camera Implementing a virtual snapshot - Coordinate system transformations - iewing

More information

Virtual Cameras & Their Matrices

Virtual Cameras & Their Matrices Virtual Cameras & Their Matrices J.Tumblin-Modified, highly edited SLIDES from: Ed Angel Professor Emeritus of Computer Science University of New Mexico 1 What is Projection? Any operation that reduces

More information

Computer Vision cmput 428/615

Computer Vision cmput 428/615 Computer Vision cmput 428/615 Basic 2D and 3D geometry and Camera models Martin Jagersand The equation of projection Intuitively: How do we develop a consistent mathematical framework for projection calculations?

More information

Agenda. Rotations. Camera models. Camera calibration. Homographies

Agenda. Rotations. Camera models. Camera calibration. Homographies Agenda Rotations Camera models Camera calibration Homographies D Rotations R Y = Z r r r r r r r r r Y Z Think of as change of basis where ri = r(i,:) are orthonormal basis vectors r rotated coordinate

More information

1 Projective Geometry

1 Projective Geometry CIS8, Machine Perception Review Problem - SPRING 26 Instructions. All coordinate systems are right handed. Projective Geometry Figure : Facade rectification. I took an image of a rectangular object, and

More information

CSE452 Computer Graphics

CSE452 Computer Graphics CSE45 Computer Graphics Lecture 8: Computer Projection CSE45 Lecture 8: Computer Projection 1 Review In the last lecture We set up a Virtual Camera Position Orientation Clipping planes Viewing angles Orthographic/Perspective

More information

Notes on Assignment. Notes on Assignment. Notes on Assignment. Notes on Assignment

Notes on Assignment. Notes on Assignment. Notes on Assignment. Notes on Assignment Notes on Assignment Notes on Assignment Objects on screen - made of primitives Primitives are points, lines, polygons - watch vertex ordering The main object you need is a box When the MODELVIEW matrix

More information

Lecture 3 Sections 2.2, 4.4. Mon, Aug 31, 2009

Lecture 3 Sections 2.2, 4.4. Mon, Aug 31, 2009 Model s Lecture 3 Sections 2.2, 4.4 World s Eye s Clip s s s Window s Hampden-Sydney College Mon, Aug 31, 2009 Outline Model s World s Eye s Clip s s s Window s 1 2 3 Model s World s Eye s Clip s s s Window

More information

Lecture 4. Viewing, Projection and Viewport Transformations

Lecture 4. Viewing, Projection and Viewport Transformations Notes on Assignment Notes on Assignment Hw2 is dependent on hw1 so hw1 and hw2 will be graded together i.e. You have time to finish both by next monday 11:59p Email list issues - please cc: elif@cs.nyu.edu

More information

Camera Model and Calibration

Camera Model and Calibration Camera Model and Calibration Lecture-10 Camera Calibration Determine extrinsic and intrinsic parameters of camera Extrinsic 3D location and orientation of camera Intrinsic Focal length The size of the

More information

CS 418: Interactive Computer Graphics. Projection

CS 418: Interactive Computer Graphics. Projection CS 418: Interactive Computer Graphics Projection Eric Shaffer Based on John Hart s CS 418 Slides Hierarchical Solar System Model Without push/pop, You can t move the Earth scale to before you draw the

More information

Viewing. Reading: Angel Ch.5

Viewing. Reading: Angel Ch.5 Viewing Reading: Angel Ch.5 What is Viewing? Viewing transform projects the 3D model to a 2D image plane 3D Objects (world frame) Model-view (camera frame) View transform (projection frame) 2D image View

More information

Midterm Exam Fundamentals of Computer Graphics (COMP 557) Thurs. Feb. 19, 2015 Professor Michael Langer

Midterm Exam Fundamentals of Computer Graphics (COMP 557) Thurs. Feb. 19, 2015 Professor Michael Langer Midterm Exam Fundamentals of Computer Graphics (COMP 557) Thurs. Feb. 19, 2015 Professor Michael Langer The exam consists of 10 questions. There are 2 points per question for a total of 20 points. You

More information

Computer Graphics Viewing

Computer Graphics Viewing Computer Graphics Viewing What Are Projections? Our 3-D scenes are all specified in 3-D world coordinates To display these we need to generate a 2-D image - project objects onto a picture plane Picture

More information

Linear and Affine Transformations Coordinate Systems

Linear and Affine Transformations Coordinate Systems Linear and Affine Transformations Coordinate Systems Recall A transformation T is linear if Recall A transformation T is linear if Every linear transformation can be represented as matrix Linear Transformation

More information

Rasterization Overview

Rasterization Overview Rendering Overview The process of generating an image given a virtual camera objects light sources Various techniques rasterization (topic of this course) raytracing (topic of the course Advanced Computer

More information

CS4620/5620: Lecture 14 Pipeline

CS4620/5620: Lecture 14 Pipeline CS4620/5620: Lecture 14 Pipeline 1 Rasterizing triangles Summary 1! evaluation of linear functions on pixel grid 2! functions defined by parameter values at vertices 3! using extra parameters to determine

More information

Rendering If we have a precise computer representation of the 3D world, how realistic are the 2D images we can generate? What are the best way to mode

Rendering If we have a precise computer representation of the 3D world, how realistic are the 2D images we can generate? What are the best way to mode Graphic Pipeline 1 Rendering If we have a precise computer representation of the 3D world, how realistic are the 2D images we can generate? What are the best way to model 3D world? How to render them?

More information

CS4620/5620. Professor: Kavita Bala. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner)

CS4620/5620. Professor: Kavita Bala. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner) CS4620/5620 Affine and 3D Transformations Professor: Kavita Bala 1 Announcements Updated schedule on course web page 2 Prelim days finalized and posted Oct 11, Nov 29 No final exam, final project will

More information

Computer Viewing. Prof. George Wolberg Dept. of Computer Science City College of New York

Computer Viewing. Prof. George Wolberg Dept. of Computer Science City College of New York Computer Viewing Prof. George Wolberg Dept. of Computer Science City College of New York Objectives Introduce the mathematics of projection Introduce OpenGL viewing functions Look at alternate viewing

More information

CS251 Spring 2014 Lecture 7

CS251 Spring 2014 Lecture 7 CS251 Spring 2014 Lecture 7 Stephanie R Taylor Feb 19, 2014 1 Moving on to 3D Today, we move on to 3D coordinates. But first, let s recap of what we did in 2D: 1. We represented a data point in 2D data

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

Today s class. Viewing transformation Menus Mandelbrot set and pixel drawing. Informationsteknologi

Today s class. Viewing transformation Menus Mandelbrot set and pixel drawing. Informationsteknologi Today s class Viewing transformation Menus Mandelbrot set and pixel drawing Monday, November 2, 27 Computer Graphics - Class 7 The world & the window World coordinates describe the coordinate system used

More information

Today. Rendering pipeline. Rendering pipeline. Object vs. Image order. Rendering engine Rendering engine (jtrt) Computergrafik. Rendering pipeline

Today. Rendering pipeline. Rendering pipeline. Object vs. Image order. Rendering engine Rendering engine (jtrt) Computergrafik. Rendering pipeline Computergrafik Today Rendering pipeline s View volumes, clipping Viewport Matthias Zwicker Universität Bern Herbst 2008 Rendering pipeline Rendering pipeline Hardware & software that draws 3D scenes on

More information

N-Views (1) Homographies and Projection

N-Views (1) Homographies and Projection CS 4495 Computer Vision N-Views (1) Homographies and Projection Aaron Bobick School of Interactive Computing Administrivia PS 2: Get SDD and Normalized Correlation working for a given windows size say

More information

Viewing with Computers (OpenGL)

Viewing with Computers (OpenGL) We can now return to three-dimension?', graphics from a computer perspective. Because viewing in computer graphics is based on the synthetic-camera model, we should be able to construct any of the classical

More information

Interactive Computer Graphics. Hearn & Baker, chapter D transforms Hearn & Baker, chapter 5. Aliasing and Anti-Aliasing

Interactive Computer Graphics. Hearn & Baker, chapter D transforms Hearn & Baker, chapter 5. Aliasing and Anti-Aliasing Interactive Computer Graphics Aliasing and Anti-Aliasing Hearn & Baker, chapter 4-7 D transforms Hearn & Baker, chapter 5 Aliasing and Anti-Aliasing Problem: jaggies Also known as aliasing. It results

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

2D and 3D Transformations AUI Course Denbigh Starkey

2D and 3D Transformations AUI Course Denbigh Starkey 2D and 3D Transformations AUI Course Denbigh Starkey. Introduction 2 2. 2D transformations using Cartesian coordinates 3 2. Translation 3 2.2 Rotation 4 2.3 Scaling 6 3. Introduction to homogeneous coordinates

More information

Geometric transformations assign a point to a point, so it is a point valued function of points. Geometric transformation may destroy the equation

Geometric transformations assign a point to a point, so it is a point valued function of points. Geometric transformation may destroy the equation Geometric transformations assign a point to a point, so it is a point valued function of points. Geometric transformation may destroy the equation and the type of an object. Even simple scaling turns a

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

CS Exam 1 Review Problems Fall 2017

CS Exam 1 Review Problems Fall 2017 CS 45500 Exam 1 Review Problems Fall 2017 1. What is a FrameBuffer data structure? What does it contain? What does it represent? How is it used in a graphics rendering pipeline? 2. What is a Scene data

More information

3D Polygon Rendering. Many applications use rendering of 3D polygons with direct illumination

3D Polygon Rendering. Many applications use rendering of 3D polygons with direct illumination Rendering Pipeline 3D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination 3D Polygon Rendering What steps are necessary to utilize spatial coherence while drawing

More information

Overview of Projections: From a 3D world to a 2D screen.

Overview of Projections: From a 3D world to a 2D screen. Overview of Projections: From a 3D world to a 2D screen. Lecturer: Dr Dan Cornford d.cornford@aston.ac.uk http://wiki.aston.ac.uk/dancornford CS2150, Computer Graphics, Aston University, Birmingham, UK

More information

Overview. Viewing and perspectives. Planar Geometric Projections. Classical Viewing. Classical views Computer viewing Perspective normalization

Overview. Viewing and perspectives. Planar Geometric Projections. Classical Viewing. Classical views Computer viewing Perspective normalization Overview Viewing and perspectives Classical views Computer viewing Perspective normalization Classical Viewing Viewing requires three basic elements One or more objects A viewer with a projection surface

More information

CS464 Oct 3 rd Assignment 3 Due 10/6/2017 Due 10/8/2017 Implementation Outline

CS464 Oct 3 rd Assignment 3 Due 10/6/2017 Due 10/8/2017 Implementation Outline CS464 Oct 3 rd 2017 Assignment 3 Due 10/6/2017 Due 10/8/2017 Implementation Outline Assignment 3 Skeleton A good sequence to implement the program 1. Start with a flat terrain sitting at Y=0 and Cam at

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

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11 Pipeline Operations CS 4620 Lecture 11 1 Pipeline you are here APPLICATION COMMAND STREAM 3D transformations; shading VERTEX PROCESSING TRANSFORMED GEOMETRY conversion of primitives to pixels RASTERIZATION

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

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

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

The Graphics Pipeline and OpenGL I: Transformations!

The Graphics Pipeline and OpenGL I: Transformations! ! The Graphics Pipeline and OpenGL I: Transformations! Gordon Wetzstein! Stanford University! EE 267 Virtual Reality! Lecture 2! stanford.edu/class/ee267/!! Logistics Update! all homework submissions:

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

Representing 2D Transformations as Matrices

Representing 2D Transformations as Matrices Representing 2D Transformations as Matrices John E. Howland Department of Computer Science Trinity University One Trinity Place San Antonio, Texas 78212-7200 Voice: (210) 999-7364 Fax: (210) 999-7477 E-mail:

More information

COMP3421. Introduction to 3D Graphics

COMP3421. Introduction to 3D Graphics COMP3421 Introduction to 3D Graphics 3D coodinates Moving to 3D is simply a matter of adding an extra dimension to our points and vectors: 3D coordinates 3D coordinate systems can be left or right handed.

More information

Chapter 8 Three-Dimensional Viewing Operations

Chapter 8 Three-Dimensional Viewing Operations Projections Chapter 8 Three-Dimensional Viewing Operations Figure 8.1 Classification of planar geometric projections Figure 8.2 Planar projection Figure 8.3 Parallel-oblique projection Figure 8.4 Orthographic

More information

CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination

CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination (Total: 100 marks) Figure 1: A perspective view of a polyhedron on an infinite plane. Cameras and Perspective Rendering

More information

CITSTUDENTS.IN VIEWING. Computer Graphics and Visualization. Classical and computer viewing. Viewing with a computer. Positioning of the camera

CITSTUDENTS.IN VIEWING. Computer Graphics and Visualization. Classical and computer viewing. Viewing with a computer. Positioning of the camera UNIT - 6 7 hrs VIEWING Classical and computer viewing Viewing with a computer Positioning of the camera Simple projections Projections in OpenGL Hiddensurface removal Interactive mesh displays Parallelprojection

More information

DD2429 Computational Photography :00-19:00

DD2429 Computational Photography :00-19:00 . Examination: DD2429 Computational Photography 202-0-8 4:00-9:00 Each problem gives max 5 points. In order to pass you need about 0-5 points. You are allowed to use the lecture notes and standard list

More information

So we have been talking about 3D viewing, the transformations pertaining to 3D viewing. Today we will continue on it. (Refer Slide Time: 1:15)

So we have been talking about 3D viewing, the transformations pertaining to 3D viewing. Today we will continue on it. (Refer Slide Time: 1:15) Introduction to Computer Graphics Dr. Prem Kalra Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture - 8 3D Viewing So we have been talking about 3D viewing, the

More information

Pipeline Operations. CS 4620 Lecture 14

Pipeline Operations. CS 4620 Lecture 14 Pipeline Operations CS 4620 Lecture 14 2014 Steve Marschner 1 Pipeline you are here APPLICATION COMMAND STREAM 3D transformations; shading VERTEX PROCESSING TRANSFORMED GEOMETRY conversion of primitives

More information

For each question, indicate whether the statement is true or false by circling T or F, respectively.

For each question, indicate whether the statement is true or false by circling T or F, respectively. True/False For each question, indicate whether the statement is true or false by circling T or F, respectively. 1. (T/F) Rasterization occurs before vertex transformation in the graphics pipeline. 2. (T/F)

More information

Graphics pipeline and transformations. Composition of transformations

Graphics pipeline and transformations. Composition of transformations Graphics pipeline and transformations Composition of transformations Order matters! ( rotation * translation translation * rotation) Composition of transformations = matrix multiplication: if T is a rotation

More information

Transformations Week 9, Lecture 18

Transformations Week 9, Lecture 18 CS 536 Computer Graphics Transformations Week 9, Lecture 18 2D Transformations David Breen, William Regli and Maxim Peysakhov Department of Computer Science Drexel University 1 3 2D Affine Transformations

More information

Computer Graphics with OpenGL ES (J. Han) Chapter VII Rasterizer

Computer Graphics with OpenGL ES (J. Han) Chapter VII Rasterizer Chapter VII Rasterizer Rasterizer The vertex shader passes the clip-space vertices to the rasterizer, which performs the following: Clipping Perspective division Back-face culling Viewport transform Scan

More information

Visualisation Pipeline : The Virtual Camera

Visualisation Pipeline : The Virtual Camera Visualisation Pipeline : The Virtual Camera The Graphics Pipeline 3D Pipeline The Virtual Camera The Camera is defined by using a parallelepiped as a view volume with two of the walls used as the near

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

Software Engineering. ò Look up Design Patterns. ò Code Refactoring. ò Code Documentation? ò One of the lessons to learn for good design:

Software Engineering. ò Look up Design Patterns. ò Code Refactoring. ò Code Documentation? ò One of the lessons to learn for good design: Software Engineering ò Look up Design Patterns ò Code Refactoring ò Code Documentation? ò One of the lessons to learn for good design: ò Coupling: the amount of interconnectedness between classes ò Cohesion:

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

COMP3421. Introduction to 3D Graphics

COMP3421. Introduction to 3D Graphics COMP3421 Introduction to 3D Graphics 3D coodinates Moving to 3D is simply a matter of adding an extra dimension to our points and vectors: 3D coordinates 3D coordinate systems can be left or right handed.

More information

CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination (Total: 100 marks)

CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination (Total: 100 marks) CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination (Total: 100 marks) Cameras and Perspective Figure 1: A perspective view of a polyhedron on an infinite plane. Rendering

More information

Coordinate Frames and Transforms

Coordinate Frames and Transforms Coordinate Frames and Transforms 1 Specifiying Position and Orientation We need to describe in a compact way the position of the robot. In 2 dimensions (planar mobile robot), there are 3 degrees of freedom

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

Perspective transformations

Perspective transformations Perspective transformations Transformation pipeline Modelview: model (position objects) + view (position the camera) Projection: map viewing volume to a standard cube Perspective division: project D to

More information

Figure 1. Lecture 1: Three Dimensional graphics: Projections and Transformations

Figure 1. Lecture 1: Three Dimensional graphics: Projections and Transformations Lecture 1: Three Dimensional graphics: Projections and Transformations Device Independence We will start with a brief discussion of two dimensional drawing primitives. At the lowest level of an operating

More information

COMP30019 Graphics and Interaction Three-dimensional transformation geometry and perspective

COMP30019 Graphics and Interaction Three-dimensional transformation geometry and perspective COMP30019 Graphics and Interaction Three-dimensional transformation geometry and perspective Department of Computing and Information Systems The Lecture outline Introduction Rotation about artibrary axis

More information

CSE 167: Introduction to Computer Graphics Lecture #3: Projection. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

CSE 167: Introduction to Computer Graphics Lecture #3: Projection. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013 CSE 167: Introduction to Computer Graphics Lecture #3: Projection Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013 Announcements Project 1 due tomorrow (Friday), presentation

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