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

Similar documents
CS 543: Computer Graphics. Projection

Geometry: Outline. Projections. Orthographic Perspective

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

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

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

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

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

Models and The Viewing Pipeline. Jian Huang CS456

Transforms 3: Projection Christian Miller CS Fall 2011

Prof. Feng Liu. Fall /19/2016

CSE528 Computer Graphics: Theory, Algorithms, and Applications

CSE 167: Lecture #4: Vertex Transformation. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

CSE328 Fundamentals of Computer Graphics

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

Announcements. Submitting Programs Upload source and executable(s) (Windows or Mac) to digital dropbox on Blackboard

Lecture 4: Viewing. Topics:

Viewing with Computers (OpenGL)

Overview. By end of the week:

COMP Computer Graphics and Image Processing. a6: Projections. In part 2 of our study of Viewing, we ll look at. COMP27112 Toby Howard

Three-Dimensional Viewing Hearn & Baker Chapter 7

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

Viewing COMPSCI 464. Image Credits: Encarta and

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

Projections. Brian Curless CSE 457 Spring Reading. Shrinking the pinhole. The pinhole camera. Required:

Computer Graphics 7: Viewing in 3-D

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

Getting Started. Overview (1): Getting Started (1): Getting Started (2): Getting Started (3): COSC 4431/5331 Computer Graphics.

Computer Graphics. Chapter 10 Three-Dimensional Viewing

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

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

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

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

Transformation Pipeline

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

CSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation

1 OpenGL - column vectors (column-major ordering)

Viewing. Reading: Angel Ch.5

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

Viewing/Projection IV. Week 4, Fri Jan 29

Mouse Ray Picking Explained

Viewing/Projections III. Week 4, Wed Jan 31

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

COMP3421. Introduction to 3D Graphics

Fundamental Types of Viewing

Game Architecture. 2/19/16: Rasterization

Lecture 4. Viewing, Projection and Viewport Transformations

3-Dimensional Viewing

Perspective matrix, OpenGL style

Viewing Transformation

SUMMARY. CS380: Introduction to Computer Graphics Projection Chapter 10. Min H. Kim KAIST School of Computing 18/04/12. Smooth Interpolation

Computer Graphics. P05 Viewing in 3D. Part 1. Aleksandra Pizurica Ghent University

COMP3421. Introduction to 3D Graphics

Viewing/Projections IV. Week 4, Fri Feb 1

COMP3421. Introduction to 3D Graphics

GRAFIKA KOMPUTER. ~ M. Ali Fauzi

CS 4204 Computer Graphics

Perspective transformations

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

Drawing in 3D (viewing, projection, and the rest of the pipeline)

THE VIEWING TRANSFORMATION

Projection Matrix Tricks. Eric Lengyel

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

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

I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S

3D Viewing. CS 4620 Lecture 8

OpenGL Transformations

CSE528 Computer Graphics: Theory, Algorithms, and Applications

CS 563 Advanced Topics in Computer Graphics Camera Models. by Kevin Kardian

CSE452 Computer Graphics

The Graphics Pipeline and OpenGL I: Transformations!

A Conceptual and Practical Look into Spherical Curvilinear Projection By Danny Oros

CMSC427 Transformations II: Viewing. Credit: some slides from Dr. Zwicker

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

3D Graphics for Game Programming (J. Han) Chapter II Vertex Processing

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

Projection and viewing. Computer Graphics CSE 167 Lecture 4

Rasterization Overview

Viewing and Projection

Drawing in 3D (viewing, projection, and the rest of the pipeline)

CPSC 314, Midterm Exam. 8 March 2013

Realtime 3D Computer Graphics & Virtual Reality. Viewing

Computer Graphics. Bing-Yu Chen National Taiwan University The University of Tokyo

Drawing in 3D (viewing, projection, and the rest of the pipeline)

Computer Graphics. Jeng-Sheng Yeh 葉正聖 Ming Chuan University (modified from Bing-Yu Chen s slides)

CS 418: Interactive Computer Graphics. Projection

CS Computer Graphics: Transformations & The Synthetic Camera

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

Reminder: Affine Transformations. Viewing and Projection. Shear Transformations. Transformation Matrices in OpenGL. Specification via Ratios

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

Viewing. Part II (The Synthetic Camera) CS123 INTRODUCTION TO COMPUTER GRAPHICS. Andries van Dam 10/10/2017 1/31

Course no. DIS4566 National Chiao Tung Univ, Taiwan By: I-Chen Lin, Assistant Professor

Computer Viewing Computer Graphics I, Fall 2008

Fachhochschule Regensburg, Germany, February 15, 2017

CSE 690: GPGPU. Lecture 2: Understanding the Fabric - Intro to Graphics. Klaus Mueller Stony Brook University Computer Science Department

Computer Graphics: Two Dimensional Viewing

file:///c /Documents%20and%20Settings/Jason%20Raftery/My%20Doc...e%20184%20-%20Spring%201998%20-%20Sequin%20-%20Midterm%202.htm

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

University of British Columbia CPSC 314 Computer Graphics Jan-Apr Tamara Munzner. Viewing 4. Page 1

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

Matrix Operations with Applications in Computer Graphics

Transcription:

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 coordinates and their uses 2 Mathematical Transformations Use transformations for moving from one coordinate space to another The good news onl requires multiplication and addition The bad news its multiplication and addition of matrices 3

Mathematical Transformations ( cont. ) Coordinate spaces we ll be using model ee normalized device ( NDC s ) window screen viewport 4 Simplified 2D Transform Pipeline What if our data is not in viewport coordinates? Stock Price??? Date World Coordinates Viewport coordinates 5 Simplified 2D Transform Pipeline ( cont. ) Need to map to viewport coordinates Simple linear transformation linear transformations can be represented b matrices x viewport x = a c b d 6 2

Almost, but not quite The 2x2 matrix isn t quite enough to do the whole job think about tring to map a point like (,) into the (,) Enter homogenous coordinates ( x ) add an additional dimension to our coordinate vector 7 Determining the Matrix Entries Matrix forms of linear transforms are shorthand for an line equation = mx + b So what we need is to determine what equations we want to write as matrices = m b x 8 Mapping World to Viewport Coordinates ( xmin Min) Stock Price Date World Coordinates ( xmax Max)??? ( xmax Max) Viewport coordinates ( xmin Min) xmax x = xmax Max = Max xmin xmax Min Max ( x xmin ) + xmin ( Min ) + Min 9 3

Or as a Matrix Let m x = xmax xmin xmax xmin m then our matrix becomes = Max Min Max Min x mx = m xmin Min m xmin x m Min x Setting up OpenGL s 2D OpenGL will do this automaticall for us gluortho2d( xmin, xmax, Min, Max ); However, it doesn t do it quite as we described first maps coordinates into normalized device coordinates ( NDC ) then maps from NDC s to viewport coordinates Normalized Device Coordinates Map each dimension linearl into[-, ] sometimes mapped to [, ] Simplifies several things clipping don t need to know viewport for clipping describes a device independent space no concerns about resolution, etc. more things which we ll get to in a minute verusefulwhenwe rein3d 2 4

Putting it all together Stock Price Date World Coordinates Stock Price Date NDC Stock Price Date Viewport Coordinates 3 Err something doesn t look right Need to match aspect ratio aspect ratio = width height Aspect ratios of different coordinate spaces need to match ar = ar 4 What s different for 3D Add another dimension ( x z w) Our transformation matrices become 4x4 More options for our projection transform 5 5

Where we re at What our transformation pipeline looks like so far... World NDC s viewport This is reall called a projection transform 6 Projection Transformations Map coordinates into NDC s Defines our viewing frustum sets the position of our imaging plane Two tpes for 3D Orthographic (or parallel) Projection gluortho2d() Perspective Projection 7 A Few Definitions First A viewing frustum is the region in space in which objects can be seen All of the visible objects in our scene will be in the viewing frustum The imaging plane is a plane in space onto which we project our scene viewing frustum controls where the imaging plane is located 8 6

Orthographic Projections Project objects in viewing frustum without distortion good for computer aided engineering and design preserves angles and relative sizes 9 Orthographic Projections ( cont. ) 2 Defining an Orthographic Projection Ver similar to mapping 2D to NDC s Use OpenGL s glortho( l, r, b, t, n, f ); 2 r l 2 t b 2 f n r+ l r l t+ b t b + n n f f 2 7

Perspective Projections Model how the ee sees objects farther from the ee are smaller A few assumptions ee is positioned at the space origin looking down the -z axis Clipping plane restrictions < near < far 22 Perspective Projections ( cont. ) Based on similar triangles n ' z 23 Perspective Projections ( cont. ) Viewing frustum looks like a truncated Egptian pramid 24 8

Defining Perspective Projections Two OpenGL versions glfrustum( l, r, b, t, n, f ); frustum not necessaril aligned down line of sight good for simulating peripheral vision gluperspective( fov, aspect, n, f ); frustum centered down line of sight more general form reasonable values: 65. < fov < 4. aspect should match aspect ratio of viewport 25 Defining a Perspective Projection glfrustum( l, r, b, t, n, f ); 2n r l 2n t b r + l r l t+ b t b ( n+ f ) f n 2nf f n 26 Defining a Perspective Projection ( cont. ) gluperspective( fov, aspect, n, f ); fov t = n tan( 2 ) b = t r = t aspect l = r then useglfrustum() 27 9

Clipping in 3D Projections transforms make clipping eas Use our favorite algorithm Clipping region well defined w x w w w w z w 28 Normalizing Projected Coordinates w is a scaling factor Perspective divide divide each coordinate b w maps into NDC s What about z? x w w z w 29