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

Similar documents
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

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

Viewing/Projections III. Week 4, Wed Jan 31

Viewing/Projection IV. Week 4, Fri Jan 29

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

Lecture 4: Viewing. Topics:

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

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

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

Computer Graphics 7: Viewing in 3-D

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

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

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

3D Geometry and Camera Calibration

CS 543: Computer Graphics. Projection

Geometry: Outline. Projections. Orthographic Perspective

COMS 4160: Problems on Transformations and OpenGL

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Chap 7, 2009 Spring Yeong Gil Shin

What and Why Transformations?

Viewing and Projection

Prof. Feng Liu. Fall /19/2016

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

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

Viewing Transformations I Comp 535

CSE528 Computer Graphics: Theory, Algorithms, and Applications

3D Viewing. CS 4620 Lecture 8

3-Dimensional Viewing

CSE328 Fundamentals of Computer Graphics

MAN-522: COMPUTER VISION SET-2 Projections and Camera Calibration

Game Architecture. 2/19/16: Rasterization

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

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

3D Coordinates & Transformations

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

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

Image Warping. Some slides from Steve Seitz

Models and The Viewing Pipeline. Jian Huang CS456

Rasterization Overview

Overview. By end of the week:

CS 4204 Computer Graphics

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

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

Computer Graphics. Chapter 10 Three-Dimensional Viewing

CSE452 Computer Graphics

Computer Graphics. Geometric Transformations

Computer Graphics. Geometric Transformations

Viewing and Projection

Viewing COMPSCI 464. Image Credits: Encarta and

Perspective transformations

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

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

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

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

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

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

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

OpenGL: Open Graphics Library. Introduction to OpenGL Part II. How do I render a geometric primitive? What is OpenGL

Lecture 4. Viewing, Projection and Viewport Transformations

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

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

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

Viewing and Projection

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

Viewing with Computers (OpenGL)

Introduction to Computer Graphics 4. Viewing in 3D

Transforms 3: Projection Christian Miller CS Fall 2011

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

Projection and viewing. Computer Graphics CSE 167 Lecture 4

Viewing. Cliff Lindsay, Ph.D. WPI

Chap 7, 2008 Spring Yeong Gil Shin

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

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)

CS Computer Graphics: Transformations & The Synthetic Camera

2D and 3D Viewing Basics

CPSC 314, Midterm Exam 1. 9 Feb 2007

Image Warping (Szeliski Sec 2.1.2)

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

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

Three-Dimensional Graphics III. Guoying Zhao 1 / 67

Computer Graphics Inf4/MSc. Computer Graphics. Lecture 6 View Projection Taku Komura

What does OpenGL do?

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

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

CPSC 314, Midterm Exam. 8 March 2013

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

Fachhochschule Regensburg, Germany, February 15, 2017

CSC 305 The Graphics Pipeline-1

Viewing and Projection

Geometric Model of Camera

Lecture 4: Transforms. Computer Graphics CMU /15-662, Fall 2016

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

Announcements. Equation of Perspective Projection. Image Formation and Cameras

Last week. Machiraju/Zhang/Möller/Fuhrmann

Viewing/Projections IV. Week 4, Fri Feb 1

Three-Dimensional Viewing Hearn & Baker Chapter 7

CS 130 Final. Fall 2015

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

Perspective matrix, OpenGL style

Transcription:

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 TAs re problems Motivation Summar: The Whole Viewing Pipeline We have seen transforms (between coord sstems) But all that is in 3D We still need to make a D picture Project 3D to D. How do we do this? This lecture is about viewing s Model coordinates Model World coordinates Camera (glulookat) Slide courtes Greg Humphres Ee coordinates Perspective (gluperspective) Screen coordinates Viewport Window coordinates Raster Device coordinates Demo (Projection Tutorial) Nate Robbins OpenGL tutors Projection tutorial Download others What we ve seen so far Transforms (translation, rotation, scale) as 44 homogeneous matrices Last row alwas 0. Last w component alwas For viewing (perspective), we will use that last row and w component no longer (must divide b it)

Projections To lower dimensional space (here 3D -> D) Preserve straight lines Trivial eample: Drop one coordinate (Orthographic) Orthographic Projection Characteristic: Parallel lines remain parallel Useful for technical drawings etc. Eample Simpl project onto plane, drop coordinate Orthographic Perspective In general We have a cuboid that we want to map to the normalied or square cube from [-, +] in all aes We have parameters of cuboid (l,r ; t,b; n,f) Orthographic Matri First center cuboid b translating Then scale into unit cube n l t f r b Translate n l t f r b Translate

M = 0 Matri 0 t b 0 0 Translation (centering) l + r 0 0 t + b f + n 0 Caveats Looking down, f and n are negative (n > f) OpenGL convention: positive n, f, negate internall t n l f r b Translate Final Result M = r + l 0 0 t + b t b t b f + n 0 glortho = r + l 0 0 t + b t b t b f + n 0 Perspective Projection Funn things happen Most common computer graphics, art, visual sstem Further objects are smaller (sie, inverse distance) Parallel lines not parallel; converge to single point A Plane of Projection A Center of projection (camera/ee location) B B Slides inspired b Greg Humphres 3

Overhead View of Our Screen In Matrices ( 0,0,0) ( ) (,,d ),, d Note negation of coord (focal plane d) (Onl) last row affected (no longer 0 ) w coord will no longer =. Must divide at end Looks like we ve got some nice similar triangles here? = d = d = d = d * 0 0 P = 0 d 0 Verif 0 0 0 d 0 =? d = d * d * d Remember projection tutorial Viewing Frustum Far plane Near plane 4

Screen (Projection Plane) gluperspective Field of view (fov) width height gluperspective(fov, aspect, Near > 0, Far > 0) Fov, aspect control fov in, directions Near, Far control viewing frustum Aspect ratio = width / height Overhead View of Our Screen ( 0,0,0) θ =? d =? θ = fov ( ) (,,d ),, d d = cotθ Simplest form: In Matrices P = aspect Aspect ratio taken into account 0 0 0 d 0 Homogeneous, simpler to multipl through b d Must map vals based on near, far planes (not et) In Matrices Z mapping derivation P = 0 0 0 d 0 aspect d aspect 0 0 d A B 0 A and B selected to map n and f to -, + respectivel A B 0 =? Simultaneous equations? A + B n = A + B f = + A + B A = f + n B = fn = A B 5

Mapping of Z is nonlinear A + B = A B Man mappings proposed: all have nonlinearities Advantage: handles range of depths (0cm 00m) Disadvantage: depth resolution not uniform More close to near plane, less further awa Common mistake: set near = 0, far = inft. Don t do this. Can t set near = 0; lose depth resolution. We discuss this more in review session Summar: The Whole Viewing Pipeline Model coordinates Model World coordinates Camera (glulookat) Slide courtes Greg Humphres Ee coordinates Perspective (gluperspective) Screen coordinates Viewport Window coordinates Raster Device coordinates 6