MIT EECS 6.837, Durand and Cutler Graphics Pipeline: Projective Transformations.

Slides:



Advertisements
Similar presentations
Graphics Pipeline.
Advertisements

Transformations.
3D Graphics Rendering and Terrain Modeling
MIT EECS 6.837, Durand and Cutler Transformations.
HCI 530 : Seminar (HCI) Damian Schofield.
Gopi -ICS186AW03 - Slide1 Graphics Pipeline: First Pass.
1 Jinxiang Chai CSCE 441 Computer Graphics. 2 Midterm Time: 10:10pm-11:20pm, 10/20 Location: HRBB 113.
Lecture 3 – Transformation And Coordinate Systems
Graphics Systems I-Chen Lin’s CG slides, Doug James’s CG slides Angel, Interactive Computer Graphics, Chap 1 Introduction to Graphics Pipeline.
Viewing Doug James’ CG Slides, Rich Riesenfeld’s CG Slides, Shirley, Fundamentals of Computer Graphics, Chap 7 Wen-Chieh (Steve) Lin Institute of Multimedia.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer.
1 Chapter 5 Viewing. 2 Perspective Projection 3 Parallel Projection.
Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)
COMP 175: Computer Graphics March 24, 2015
Viewing and Projections
Computer Graphics Panos Trahanias ΗΥ358 Spring 2009.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Week 2 - Wednesday CS361.
Computer Graphics An Introduction. What’s this course all about? 06/10/2015 Lecture 1 2 We will cover… Graphics programming and algorithms Graphics data.
Computer Graphics. Requirements Prerequisites Prerequisites CS 255 : Data Structures CS 255 : Data Structures Math 253 Math 253 Experience with C Programming.
Week 5 - Wednesday.  What did we talk about last time?  Project 2  Normal transforms  Euler angles  Quaternions.
CS559: Computer Graphics Lecture 9: Projection Li Zhang Spring 2008.
CS-378: Game Technology Lecture #2.1: Projection Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic, Jessica.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1Computer Graphics Lecture 4 - Models and Architectures John Shearer Culture Lab – space 2
COMPUTER GRAPHICS CSCI 375. What do I need to know?  Familiarity with  Trigonometry  Analytic geometry  Linear algebra  Data structures  OOP.
CAP4730: Computational Structures in Computer Graphics 3D Transformations.
MIT EECS 6.837, Durand and Cutler Transformations.
10/3/02 (c) 2002 University of Wisconsin, CS 559 Last Time 2D Coordinate systems and transformations.
Programming 3D Applications CE Displaying Computer Graphics Week 3 Lecture 5 Bob Hobbs Faculty of Computing, Engineering and Technology Staffordshire.
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
CS559: Computer Graphics Lecture 9: Rasterization Li Zhang Spring 2008.
CS 450: COMPUTER GRAPHICS PROJECTIONS SPRING 2015 DR. MICHAEL J. REALE.
MIT EECS Frédo Durand and Barb Cutler
Mark Nelson 3d projections Fall 2013
Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group computer graphics & visualization 3D Rendering Praktikum: Shader Gallery The.
Computer Graphics Lecture 08 Fasih ur Rehman. Last Class Ray Tracing.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Subject Name: Computer Graphics Subject Code: Textbook: “Computer Graphics”, C Version By Hearn and Baker Credits: 6 1.
©2005, Lee Iverson Lee Iverson UBC Dept. of ECE EECE 478 Viewing and Projection.
MIT EECS 6.837, Durand and Cutler The Graphics Pipeline: Projective Transformations.
1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis.
CS559: Computer Graphics Final Review Li Zhang Spring 2010.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group computer graphics & visualization GameFX C# / DirectX 2005 The Rendering Pipeline.
Viewing and Projection
MIT EECS 6.837, Durand and Cutler The Graphics Pipeline: Line Clipping & Line Rasterization.
Midterm Review. Overall No OpenGL programming questions, but programming pipeline and concepts of important OpenGL functions are required. – Parameter.
Viewing and Projection. The topics Interior parameters Projection type Field of view Clipping Frustum… Exterior parameters Camera position Camera orientation.
Computer Graphics One of the central components of three-dimensional graphics has been a basic system that renders objects represented by a set of polygons.
Chapter 1 Graphics Systems and Models Models and Architectures.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Models and Architectures 靜宜大學 資訊工程系 蔡奇偉 副教授 2012.
Visible Surface Detection
- Introduction - Graphics Pipeline
Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics
CSCE 441 Computer Graphics 3-D Viewing
3D Graphics Rendering PPT By Ricardo Veguilla.
CENG 477 Introduction to Computer Graphics
3D Clipping.
Real-time Computer Graphics Overview
Models and Architectures
Models and Architectures
Models and Architectures
Introduction to Computer Graphics with WebGL
Computer Graphics One of the central components of three-dimensional graphics has been a basic system that renders objects represented by a set of polygons.
Models and Architectures
Models and Architectures
Presentation transcript:

MIT EECS 6.837, Durand and Cutler Graphics Pipeline: Projective Transformations

MIT EECS 6.837, Durand and Cutler Movies both pipeline and ray tracing

MIT EECS 6.837, Durand and Cutler Games pipeline

MIT EECS 6.837, Durand and Cutler Simulation pipeline (painter for a long time)

MIT EECS 6.837, Durand and Cutler CAD-CAM & Design pipeline during design, anything for final image

MIT EECS 6.837, Durand and Cutler Architecture ray-tracing, pipeline with preprocessing for complex lighting

MIT EECS 6.837, Durand and Cutler Virtual Reality pipeline

MIT EECS 6.837, Durand and Cutler Visualization mostly pipeline, ray-tracing for high-quality eye candy, interactive ray-tracing is starting

MIT EECS 6.837, Durand and Cutler Medical Imaging same as visualization

MIT EECS 6.837, Durand and Cutler The Graphics Pipeline Modeling Transformations Illumination (Shading) Viewing Transformation (Perspective / Orthographic) Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display

MIT EECS 6.837, Durand and Cutler The Graphics Pipeline Primitives are processed in a series of stages Each stage forwards its result on to the next stage The pipeline can be drawn and implemented in different ways Some stages may be in hardware, others in software Optimizations & additional programmability are available at some stages Modeling Transformations Illumination (Shading) Viewing Transformation (Perspective / Orthographic) Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display

MIT EECS 6.837, Durand and Cutler Modeling Transformations 3D models defined in their own coordinate system (object space) Modeling transforms orient the models within a common coordinate frame (world space) Modeling Transformations Illumination (Shading) Viewing Transformation (Perspective / Orthographic) Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display Object spaceWorld space

MIT EECS 6.837, Durand and Cutler Illumination (Shading) (Lighting) Vertices lit (shaded) according to material properties, surface properties (normal) and light sources Local lighting model (Diffuse, Ambient, Phong, etc.) Modeling Transformations Illumination (Shading) Viewing Transformation (Perspective / Orthographic) Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display

MIT EECS 6.837, Durand and Cutler Viewing Transformation Maps world space to eye space Viewing position is transformed to origin & direction is oriented along some axis (usually z) Modeling Transformations Illumination (Shading) Viewing Transformation (Perspective / Orthographic) Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display Eye space World space

MIT EECS 6.837, Durand and Cutler Clipping Transform to Normalized Device Coordinates (NDC) Portions of the object outside the view volume (view frustum) are removed Modeling Transformations Illumination (Shading) Viewing Transformation (Perspective / Orthographic) Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display Eye spaceNDC

MIT EECS 6.837, Durand and Cutler Projection The objects are projected to the 2D image place (screen space) Modeling Transformations Illumination (Shading) Viewing Transformation (Perspective / Orthographic) Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display NDC Screen Space

MIT EECS 6.837, Durand and Cutler Scan Conversion (Rasterization) Rasterizes objects into pixels Interpolate values as we go (color, depth, etc.) Modeling Transformations Illumination (Shading) Viewing Transformation (Perspective / Orthographic) Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display

MIT EECS 6.837, Durand and Cutler Visibility / Display Each pixel remembers the closest object (depth buffer) Almost every step in the graphics pipeline involves a change of coordinate system. Transformations are central to understanding 3D computer graphics. Modeling Transformations Illumination (Shading) Viewing Transformation (Perspective / Orthographic) Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display

MIT EECS 6.837, Durand and Cutler Common Coordinate Systems Object space –local to each object World space –common to all objects Eye space / Camera space –derived from view frustum Clip space / Normalized Device Coordinates (NDC) –[-1,-1,-1] → [1,1,1] Screen space –indexed according to hardware attributes

MIT EECS 6.837, Durand and Cutler Coordinate Systems in the Pipeline Modeling Transformations Illumination (Shading) Viewing Transformation (Perspective / Orthographic) Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display Object space World space Eye Space / Camera Space Clip Space (NDC) Screen Space

MIT EECS 6.837, Durand and Cutler Questions?

MIT EECS 6.837, Durand and Cutler Today Ray Casting / Tracing vs. Scan Conversion The Graphics Pipeline Projective Transformations –Transformations & Homogeneous Coordinates –Orthographic & Perspective Projections –Coordinate Systems & Projections in the Pipeline –Canonical View Volume Introduction to Clipping

MIT EECS 6.837, Durand and Cutler Remember Transformations? Translation Rotation Rigid / Euclidean Linear Affine Projective Similitudes Isotropic Scaling Scaling Shear Reflection Perspective Identity

MIT EECS 6.837, Durand and Cutler Homogeneous Coordinates Most of the time w = 1, and we can ignore it If we multiply a homogeneous coordinate by an affine matrix, w is unchanged x' y' z' 1 = xyz1xyz1 aei0aei0 bfj0bfj0 cgk0cgk0 dhl1dhl1

MIT EECS 6.837, Durand and Cutler Homogeneous Visualization Divide by w to normalize (homogenize) W = 0? w = 1 w = 2 (0, 0, 1) = (0, 0, 2) = … (7, 1, 1) = (14, 2, 2) = … (4, 5, 1) = (8, 10, 2) = … Point at infinity (direction)

MIT EECS 6.837, Durand and Cutler Orthographic vs. Perspective Orthographic Perspective

MIT EECS 6.837, Durand and Cutler Simple Orthographic Projection Project all points along the z axis to the z = 0 plane xy01xy01 = xyz1xyz

MIT EECS 6.837, Durand and Cutler Simple Perspective Projection Project all points to the z = d plane, eyepoint at the origin: x y z z / d = xyz1xyz /d x * d / z y * d / z d 1 = homogenize

MIT EECS 6.837, Durand and Cutler Alternate Perspective Projection Project all points to the z = 0 plane, eyepoint at the (0,0,-d): x y 0 (z + d)/ d = xyz1xyz /d x * d / (z + d) y * d / (z + d) 0 1 = homogenize

MIT EECS 6.837, Durand and Cutler In the limit, as d → ∞ /d →...is simply an orthographic projection this perspective projection matrix...

MIT EECS 6.837, Durand and Cutler Where are projections in the pipeline? Modeling Transformations Illumination (Shading) Viewing Transformation (Perspective / Orthographic) Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display Eye Space / Camera Space Clip Space (NDC) Screen Space

MIT EECS 6.837, Durand and Cutler World Space → Eye Space Positioning the camera Translation + Change of orthonormal basis Given: coordinate frames xyz & uvn, and point p = (x,y,z) Find: p = (u,v,n) x y v u p x y u v

MIT EECS 6.837, Durand and Cutler Change of Orthonormal Basis uvnuvn = xyzxyz uxvxnxuxvxnx uyvynyuyvyny uzvznzuzvznz u x = x. u where: etc. u y = y. u x y v u p x y u v

MIT EECS 6.837, Durand and Cutler Normalized Device Coordinates Clipping is more efficient in a rectangular, axis-aligned volume: (-1,-1,-1) → (1,1,1) OR (0,0,0) → (1,1,1)

MIT EECS 6.837, Durand and Cutler Canonical Orthographic Projection

MIT EECS 6.837, Durand and Cutler Canonical Perspective Projection

MIT EECS 6.837, Durand and Cutler Questions?

MIT EECS 6.837, Durand and Cutler Today Ray Casting / Tracing vs. Scan Conversion The Graphics Pipeline Projective Transformations Introduction to Clipping –Projecting to the Image Plane –Why Clip? –Clipping Strategies

MIT EECS 6.837, Durand and Cutler What if the p z is > eye z ? (eye x, eye y, eye z ) image plane z axis → +

MIT EECS 6.837, Durand and Cutler What if the p z is < eye z ? (eye x, eye y, eye z ) image plane z axis → +

MIT EECS 6.837, Durand and Cutler What if the p z = eye z ? (eye x, eye y, eye z ) image plane ??? z axis → +

MIT EECS 6.837, Durand and Cutler Clipping (eye x, eye y, eye z ) image plane "clip" geometry to view frustum z axis → +

MIT EECS 6.837, Durand and Cutler Clipping Eliminate portions of objects outside the viewing frustum View Frustum –boundaries of the image plane projected in 3D –a near & far clipping plane User may define additional clipping planes bottom top right left near far

MIT EECS 6.837, Durand and Cutler Why Clip? Avoid degeneracies –Don’t draw stuff behind the eye –Avoid division by 0 and overflow Efficiency –Don’t waste time on objects outside the image boundary Other graphics applications (often non-convex) –Hidden-surface removal, Shadows, Picking, Binning, CSG (Boolean) operations (2D & 3D)

MIT EECS 6.837, Durand and Cutler Clipping Strategies Don’t clip (and hope for the best) Clip on-the-fly during rasterization Analytical clipping: alter input geometry

MIT EECS 6.837, Durand and Cutler Next Time: Clipping & Line Rasterization