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

Similar documents
Reading. 18. Projections and Z-buffers. Required: Watt, Section , 6.3, 6.6 (esp. intro and subsections 1, 4, and 8 10), Further reading:

Projections and Hardware Rendering. Brian Curless CSE 557 Fall 2014

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

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

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

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

Chap 7, 2009 Spring Yeong Gil Shin

Lecture 4: Viewing. Topics:

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

CS 351: Perspective Viewing

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

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

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

CSE528 Computer Graphics: Theory, Algorithms, and Applications

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

CSE328 Fundamentals of Computer Graphics

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

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

Introduction to Computer Graphics 4. Viewing in 3D

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

3D Viewing. CS 4620 Lecture 8

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

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

Homework #2. Hidden Surfaces, Projections, Shading and Texture, Ray Tracing, and Parametric Curves

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

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

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

Three-Dimensional Graphics III. Guoying Zhao 1 / 67

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

2D and 3D Viewing Basics

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

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

Viewing Transformations I Comp 535

COSC579: Scene Geometry. Jeremy Bolton, PhD Assistant Teaching Professor

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)

3D Viewing. With acknowledge to: Ed Angel. Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Computer Graphics 7: Viewing in 3-D

CS 543: Computer Graphics. Projection

Chapter 5. Projections and Rendering

3-Dimensional Viewing

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

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

Projective Geometry and Camera Models

Perspective projection. A. Mantegna, Martyrdom of St. Christopher, c. 1450

window World space (Object space)

CMPSCI 670: Computer Vision! Image formation. University of Massachusetts, Amherst September 8, 2014 Instructor: Subhransu Maji

Viewing/Projections III. Week 4, Wed Jan 31

(Refer Slide Time: 00:01:26)

DD2423 Image Analysis and Computer Vision IMAGE FORMATION. Computational Vision and Active Perception School of Computer Science and Communication

Viewing with Computers (OpenGL)

Game Architecture. 2/19/16: Rasterization

CS 2770: Intro to Computer Vision. Multiple Views. Prof. Adriana Kovashka University of Pittsburgh March 14, 2017

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

Distribution Ray Tracing

Realtime 3D Computer Graphics & Virtual Reality. Viewing

5.8.3 Oblique Projections

Lecture 4. Viewing, Projection and Viewport Transformations

Models and Architectures. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Three-Dimensional Viewing Hearn & Baker Chapter 7

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Introduction to Computer Graphics with WebGL

CS 418: Interactive Computer Graphics. Projection

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

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

CS 4204 Computer Graphics

On the Midterm Exam. Monday, 10/17 in class. Closed book and closed notes. One-side and one page cheat sheet is allowed. A calculator is allowed

Modeling Light. On Simulating the Visual Experience

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

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

Discover how to solve this problem in this chapter.

Models and The Viewing Pipeline. Jian Huang CS456

Chapter 4-3D Camera & Optimizations, Rasterization

Raycasting. Chapter Raycasting foundations. When you look at an object, like the ball in the picture to the left, what do

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

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

Models and Architectures

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

Pipeline Operations. CS 4620 Lecture 10

Chap 7, 2008 Spring Yeong Gil Shin

Pinhole Camera Model 10/05/17. Computational Photography Derek Hoiem, University of Illinois

Projective Geometry and Camera Models

Geometry: Outline. Projections. Orthographic Perspective

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

3D graphics, raster and colors CS312 Fall 2010

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

Computer Vision CS 776 Fall 2018

OpenGL Transformations

Subdivision surfaces. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

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

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

Announcements. Tutorial this week Life of the polygon A1 theory questions

Image formation - About the course. Grading & Project. Tentative Schedule. Course Content. Students introduction

Computer Graphics I Lecture 11

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

Chapter 8 Three-Dimensional Viewing Operations

Chapter 5-3D Camera & Optimizations, Rasterization

Determining the 2d transformation that brings one image into alignment (registers it) with another. And

CS354 Computer Graphics Ray Tracing. Qixing Huang Januray 24th 2017

Projection and viewing. Computer Graphics CSE 167 Lecture 4

Overview. By end of the week:

Transcription:

Reading Required: Projections Brian Curless CSE 457 Spring 2013 Angel, 5.1-5.6 Further reading: Fole, et al, Chapter 5.6 and Chapter 6 David F. Rogers and J. Alan Adams, Mathematical Elements for Computer Graphics, 2 nd Ed., McGraw-Hill, New York, 1990, Chapter 2. I. E. Sutherland, R. F. Sproull, and R. A. Schumacker, A characterization of ten hidden surface algorithms, ACM Computing Surves 6(1): 1-55, March 1974. 1 2 The pinhole camera Shrinking the pinhole The first camera - camera obscura - known to Mozi and Aristotle (ca., 350-400 BC). In 3D, we can visualize the blur induced b the pinhole (a.k.a., aperture): [Hecht, 1987] Q: What happens as we continue to shrink the aperture? Q: How would we reduce blur? [Hecht, 1987] 3 4

Shrinking the pinhole, cont d Imaging with the snthetic camera In practice, pinhole cameras require long exposures, can suffer from diffraction effects, and give an inverted image. In graphics, none of these phsical limitations is a problem. [Angel, 2011] The image is rendered onto an image plane (usuall in front of the camera). Viewing ras emanate from the center of projection (COP) at the center of the pinhole. The image of an object point P is at the intersection of the viewing ra through P and the image plane. [Hecht, 1987] 5 But is P visible? This the problem of hidden surface removal (a.k.a., visible surface determination). 6 Ra casting Ra casting, cont. One wa to simulate the pinhole camera and determine which point is visible at each pixel is ra casting. Implementation: Might parameterize each ra: r(t) = C + t (P ij - C) Idea: For each pixel center P ij Send ra from ee point (COP), C, through P ij into scene. Intersect ra with each object. Select nearest intersection. where t > 0. Each object O k returns t k > 0 such that first intersection with O k occurs at r(t k ). Q: Given the set {t k } what is the first intersection point? 7 8

Warping space A ver different approach is to take the imaging setup: 3D Geometr Pipeline Graphics hardware follows the warping space approach. Before being turned into pixels, a piece of geometr goes through a number of transformations... then warp all of space so that all the ras are parallel (and distant objects are smaller than closer objects): and then just draw everthing onto the image plane, keeping track of what is in front: 9 10 3D Geometr Pipeline (cont d) Projections Projections transform points in n-space to m-space, where m<n. In 3-D, we map points from 3-space to the projection plane (PP) (a.k.a., image plane) along projectors (a.k.a., viewing ras) emanating from the center of projection (COP): There are two basic tpes of projections: Perspective distance from COP to PP finite Parallel distance from COP to PP infinite 11 12

Parallel projections For parallel projections, we specif a direction of projection (DOP) instead of a COP. There are two tpes of parallel projections: Orthographic projection DOP perpendicular to PP Oblique projection DOP not perpendicular to PP We can write orthographic projection onto the z=0 plane with a simple matrix. x x ' 1 0 0 0 ' 0 1 0 0 z 1 0 0 0 1 1 Normall, we do not drop the z value right awa. Wh not? Z-buffer The Z-buffer or depth buffer algorithm [Catmull, 1974] can be used to determine which surface point is visible at each pixel. Here is pseudocode for the Z-buffer hidden surface algorithm: for each pixel (i,j) do Z-buffer [i,j] FAR Framebuffer[i,j] <background color> end for for each polgon A do for each pixel in A do Compute depth z of A at (i,j) if z > Z-buffer [i,j] then Z-buffer [i,j] z Framebuffer[i,j] color of A end if end for end for Q: What should FAR be set to? 13 14 Rasterization The process of filling in the pixels inside of a polgon is called rasterization. During rasterization, the z value can be computed incrementall (fast!). Properties of parallel projection Properties of parallel projection: Not realistic looking Good for exact measurements Are actuall a kind of affine transformation Parallel lines remain parallel Ratios are preserved Angles not (in general) preserved Most often used in CAD, architectural drawings, etc., where taking exact measurement is important Curious fact: Described as the brute-force image space algorithm b [SSS] Mentioned onl in Appendix B of [SSS] as a point of comparison for huge memories, but written off as totall impractical. Toda, Z-buffers are commonl implemented in hardware. 15 16

Derivation of perspective projection Consider the projection of a point onto the projection plane: Homogeneous coordinates revisited Remember how we said that affine transformations work with the last coordinate alwas set to one. What happens if the coordinate is not one? We divide all the coordinates b w: B similar triangles, we can compute how much the x and coordinates are scaled: x x/ w / w z z/ w w 1 If w = 1, then nothing changes. Sometimes we call this division step the perspective divide. [Note: Angel takes d to be a negative number, and thus avoids using a minus sign.] 17 18 Homogeneous coordinates and perspective projection Now we can re-write the perspective projection as a matrix equation: x x' 1 0 0 0 x ' 0 1 0 0 z w' 0 0 1/ d 0 z/ d 1 Projective normalization After appling the perspective transformation and dividing b w, we are free to do a simple parallel projection to get the 2D image. What does this impl about the shape of things after the perspective transformation + divide? After division b w, we get: d x x ' z d ' z 1 1 Again, projection implies dropping the z coordinate to give a 2D image, but we usuall keep it around a little while longer. 19 20

Viewing angle Zoom and doll An alternative to specifing the distance from COP to PP is to specif a viewing angle: Given the height of the image h and, what is d? What happens to d as increases (while h is constant)? 21 22 Vanishing points Vanishing points (cont'd) What happens to two parallel lines that are not parallel to the projection plane? Dividing b w: px p z x' ' p p w ' z Think of train tracks receding into the horizon... tv x tv z tv d d tv z 1 Letting t go to infinit: The equation for a line is: p x v x p v l p tv t pz v z 1 0 We get a point! What happens to the line l = q + tv? After perspective transformation we get: Each set of parallel lines intersect at a vanishing point on the PP. x ' p x tv x ' p tv w ' ( pz tv z )/ d Q: How man vanishing points are there? 23 24

Clipping and the viewing frustum The center of projection and the portion of the projection plane that map to the final image form an infinite pramid. The sides of the pramid are clipping planes. Frequentl, additional clipping planes are inserted to restrict the range of depths. These clipping planes are called the near and far or the hither and on clipping planes. Properties of perspective projections The perspective projection is an example of a projective transformation. Here are some properties of projective transformations: Lines map to lines Parallel lines do not necessaril remain parallel Ratios are not preserved One of the advantages of perspective projection is that size varies inversel with distance looks realistic. A disadvantage is that we can't judge distances as exactl as we can with parallel projections. All of the clipping planes bound the the viewing frustum. 25 26 Human vision and perspective The human visual sstem uses a lens to collect light more efficientl, but records perspectivel projected images much like a pinhole camera. [Glassner, 1995] Q: Wh did nature give us ees that perform perspective projections? Q: Do our ees see in 3D? 27 28

3D Displas So-called 3D displas are all the rage now for movies and soon for televisions. Much of our perception of 3D comes from stereo vision: each ee sees a different view of the world. So, to create the illusion of 3D, we onl need to show each ee an image of a scene created from that ee s point of view! 29 30 3D Displas, cont d 3D Displas, cont d Screen Screen Viewer Viewer 31 32

3D Displas, cont d Summar Viewer Screen What to take awa from this lecture: All the boldfaced words. An appreciation for the various coordinate sstems used in computer graphics. How to compute the world->ee coordinate transformation with glulookat. How a pinhole camera works. How orthographic projection works. How the perspective transformation works. How we use homogeneous coordinates to represent perspective projections. The properties of vanishing points. The mathematical properties of projective transformations. 33 34