Viewing and Projection

Similar documents
Viewing/Projections III. Week 4, Wed Jan 31

Viewing/Projection IV. Week 4, Fri Jan 29

Viewing and Projection Transformations

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

CS 475 / CS 675 Computer Graphics. Lecture 7 : The Modeling-Viewing Pipeline

Lecture 4: Viewing. Topics:

Viewing Transformation

Viewing/Projections IV. Week 4, Fri Feb 1

CSE528 Computer Graphics: Theory, Algorithms, and Applications

CPSC 314, Midterm Exam 1. 9 Feb 2007

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

News. Projections and Picking. Transforming View Volumes. Projections recap. Basic Perspective Projection. Basic Perspective Projection

CS Computer Graphics: Transformations & The Synthetic Camera

Realtime 3D Computer Graphics & Virtual Reality. Viewing

Viewing. Cliff Lindsay, Ph.D. WPI

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

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. Motivation. Demo (Projection Tutorial) What we ve seen so far. Computer Graphics. Summary: The Whole Viewing Pipeline

CS 543: Computer Graphics. Projection

What does OpenGL do?

Chap 7, 2009 Spring Yeong Gil Shin

CPSC 314, Midterm Exam. 8 March 2013

CPSC 314, Midterm Exam. 8 March 2010

Perspective transformations

5.8.3 Oblique Projections

Three-Dimensional Viewing Hearn & Baker Chapter 7

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

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

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

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

Viewing transformations. 2004, Denis Zorin

3-Dimensional Viewing

Lecture 4: 3D viewing and projections

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

The 3-D Graphics Rendering Pipeline

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

CS770/870 Spring 2017 Transformations

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

Transformations II. Week 2, Wed Jan 17

3D Viewing. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

3D Geometry and Camera Calibration

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

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

3D Viewing and Projec5on. Taking Pictures with a Real Camera. Steps: Graphics does the same thing for rendering an image for 3D geometric objects

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

Chap 7, 2008 Spring Yeong Gil Shin

Viewing. Reading: Angel Ch.5

Lecture 4. Viewing, Projection and Viewport Transformations

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

The Graphics Pipeline and OpenGL I: Transformations!

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

Overview. By end of the week:

Rasterization Overview

3D Viewing. Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

Computer Graphics. Geometric Transformations

Computer Graphics. Geometric Transformations

3D Coordinates & Transformations

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

Two Dimensional Viewing

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

Geometric Model of Camera

Viewing in 3D (Chapt. 6 in FVD, Chapt. 12 in Hearn & Baker)

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

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

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

Uses of Transformations. 2D transformations Homogeneous coordinates. Transformations. Transformations. Transformations. Transformations and matrices

Introduction to Computer Graphics 4. Viewing in 3D

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

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

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

Computer Viewing Computer Graphics I, Fall 2008

Midterm Review. Wen-Chieh (Steve) Lin Department of Computer Science

Game Architecture. 2/19/16: Rasterization

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Models and The Viewing Pipeline. Jian Huang CS456

1 OpenGL - column vectors (column-major ordering)

Transformations III. Week 2, Fri Jan 19

3D Viewing. CS 4620 Lecture 8

Today. The Graphics Pipeline: Projective Transformations. Last Week: Schedule. XForms Forms Library. Questions?

Affine Transformations in 3D

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

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

Virtual Cameras & Their Matrices

CSE328 Fundamentals of Computer Graphics

Computer Viewing. CITS3003 Graphics & Animation. E. Angel and D. Shreiner: Interactive Computer Graphics 6E Addison-Wesley

Must first specify the type of projection desired. When use parallel projections? For technical drawings, etc. Specify the viewing parameters

OUTPUT PRIMITIVES. CEng 477 Introduction to Computer Graphics METU, 2007

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

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

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

CSCI-4530/6530 Advanced Computer Graphics

CS770/870 Spring 2017 Transformations

GEOMETRIC TRANSFORMATIONS AND VIEWING

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

Modeling Transformations Revisited

Homogeneous Coordinates

3D Viewing Episode 2

Announcements. Equation of Perspective Projection. Image Formation and Cameras

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

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

Transcription:

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 volume VCS =left =top =bottom =-near =right orthographic view volume =left VCS =-far =bottom =top =right =-near =-far Projective Rendering Pipeline object OCS modeling world WCS OCS - object coordinate sstem WCS - world coordinate sstem VCS - viewing coordinate sstem CCS - clipping coordinate sstem NDCS - normalied device coordinate sstem DCS - device coordinate sstem viewing/camera VCS viewing Model view matri Projection matri projection clipping / w viewport clipping CCS normalied device NDCS Viewport matri device DCS 2

Viewing Transformation object world viewing OCS modeling M mod WCS viewing M cam OpenGL ModelView matri VCS Arbitrar Viewing Position General situation for camera Keep view frame unchanged Map object with the inverse of the frame v n ee -n u 3

Deriving the model view matri ee point P = (,,, ) viewplane normal n = (n, n, n, ) up vector v = (v, v, v, ) u = v n unit vectors u, v, n v n ee -n u Model view matri details Rotation matri: M Object rotations: R = M- = MT = Ø Œ Œ Œ Œ º u' u' u' v' v' v' n' n' n' ø œ œ œ œ ß Translation T = V = RT Ø Œ Œ Œ Œ º -ø - œ œ -œ œ ß 4

Arbitrar Viewing Position rotate/translate/scale not intuitive convenient formulation ee point, lookat direction, up vector Look-at function Input p: ee point q: look at point v : approimation of up vector n = p q v = v (v. n).n u = v n Normalie OpenGL utilit function glulookat(e, e, e, l, l, l, u, u, u) 5

Viewing Transformation OpenGL glulookat(e,e,e,l,l,l,u,u,u) usuall use as follows: glmatrimode(gl_modelview); glloadidentit(); glulookat(e,e,e,l,l,l,u,u,u) // now ok to do model s Field-of-View Formulation FOV in one direction + aspect ratio (w/h) determines FOV in other direction also set near, far (reasonabl intuitive) w a Frustum - fov/2 fov/2 h =-n =-f 6

Viewing and Projection Standard situation camera at origin, pointing in direction, orthogonal projection Map camera to a general situation Or Map all objects in to the standard situation of camera Canonical view volume transform an arbitrar orthogonal to canonical view volume = +/-, = +/-, = +/- translate centre scale matri? 7

Orthographic Derivation scale, translate, reflect for new coord ss VCS NDCS =left =top =right (-,-,-) (,,) =bottom =-near =-far Orthographic Derivation ' = a + b solving for a and b gives: a = 2 top bot = top = bot b = ' = ' = ( top + bot) top bot same idea for right/left, far/near 8

Orthographic Derivation scale, translate, reflect for new coord ss 2 right left P = ' 2 top bot 2 far near right + left right left top + bot top bot P far + near far near Perspective normaliation simple case COP at origin projection plane at = - = +/-, = +/- matri? 9

Projective Transformations of space center of projection moves to infinit viewing frustum transformed into a parallelepiped Frustum - - Projective Transformations can epress as homogeneous 44 matrices! 6 matri entries multiples of same matri all describe same 5 degrees of freedom mapping of 5 points uniquel determines

Projective Transformations determining the matri representation need to observe 5 points in general position, e.g. [left,,,] T [,,,] T [,top,,] T [,,,] T [,,-f,] T [,,,] T [,,-n,] T [,,,] T [left*f/n,top*f/n,-f,] T [,,,] T solve resulting equation sstem to obtain matri Perspective Derivation VCS =top NDCS =left (,,) =bottom =-near =right =-far (-,-,-)

2 Normalied Device Coordinates left/right =+/-, top/bottom =+/-, near/far =+/- - Frustum Frustum = =-n = =-f right right left left = = - = = = = Camera coordinates Camera coordinates NDC NDC = = - Perspective Derivation earlier: earlier: complete: shear, scale, projection complete: shear, scale, projection-normaliation normaliation = / / d d = ' ' ' ' D C B F A E h

3 Perspective Derivation similarl for other 5 planes 6 planes, 6 unknowns + + + 2 ) ( 2 2 n f fn n f n f b t b t b t n l r l r l r n

Perspective Eample view volume left = -, right = bot = -, top = near =, far = 4 2n r l 2n t b r + l r l t + b t ( b f + n) f n 2 fn f n 5/ 3 8/ 3 Perspective Eample tracks in VCS: left =-, =- right =, =- view volume left = -, right = bot = -, top = near =, far = 4 =- = ma- =-4 =- real midpoint - - - NDCS DCS ma- VCS top view ( not shown) ( not shown) 4

Viewport Transformation generate piel coordinates map, from range (normalied device coordinates) to piel coordinates on the displa involves 2D scaling and translation displa viewport Holbein the ounger 497-543 First discussed b da Vinci as Anamorphosis From Greek word meaning to transform 5

Holbein the ounger 497-543 No record or an mention of this skull until 873 Portrait of Prince Edward VI William Scrots 546 6

Portrait of Prince Edward VI William Scrots 546 7