CS 450: COMPUTER GRAPHICS PROJECTIONS SPRING 2015 DR. MICHAEL J. REALE.

Slides:



Advertisements
Similar presentations
Computer Graphics - Viewing -
Advertisements

Lecture 3: Transformations and Viewing. General Idea Object in model coordinates Transform into world coordinates Represent points on object as vectors.
MAT 594CM S2010Fundamentals of Spatial ComputingAngus Forbes Overview Goals of the course: 1. to introduce real-time 3D graphics programming with openGL.
Computer Graphics Lecture 4 Geometry & Transformations.
1 Computer Graphics Chapter 8 3D Transformations.
CS 4363/6353 INTRODUCTION TO COMPUTER GRAPHICS. WHAT YOU’LL SEE Interactive 3D computer graphics Real-time 2D, but mostly 3D OpenGL C/C++ (if you don’t.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner Viewing/Projections III.
Based on slides created by Edward Angel
Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 5: Viewing
CS 352: Computer Graphics Chapter 5: Viewing. Interactive Computer GraphicsChapter Overview Specifying the viewpoint Specifying the projection Types.
Viewing Doug James’ CG Slides, Rich Riesenfeld’s CG Slides, Shirley, Fundamentals of Computer Graphics, Chap 7 Wen-Chieh (Steve) Lin Institute of Multimedia.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner Viewing/Projections I.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Viewing and Projections Mon 22 Sep 2003 project 1 solution demo recap: projections.
CHAPTER 7 Viewing and Transformations © 2008 Cengage Learning EMEA.
CS 450: Computer Graphics 2D TRANSFORMATIONS
2/26/04© University of Wisconsin, CS559 Spring 2004 Last Time General Orthographic Viewing –Specifying cameras in world coordinates –Building world  view.
CS 450: COMPUTER GRAPHICS 3D TRANSFORMATIONS SPRING 2015 DR. MICHAEL J. REALE.
Introduction to 3D viewing 3D is just like taking a photograph!
Geometric Intuition Randy Gaul. Vectors, Points and Basis Matrices Rotation Matrices Dot product and how it’s useful Cross product and how it’s useful.
Viewing and Projections
CSE 381 – Advanced Game Programming Basic 3D Graphics
02/26/02 (c) 2002 University of Wisconsin, CS 559 Last Time Canonical view pipeline Orthographic projection –There was an error in the matrix for taking.
Week 5 - Wednesday.  What did we talk about last time?  Project 2  Normal transforms  Euler angles  Quaternions.
MIT EECS 6.837, Durand and Cutler Graphics Pipeline: Projective Transformations.
2 COEN Computer Graphics I Evening’s Goals n Discuss the mathematical transformations that are utilized for computer graphics projection viewing.
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.
Computer Graphics Bing-Yu Chen National Taiwan University.
CAP4730: Computational Structures in Computer Graphics 3D Transformations.
10/3/02 (c) 2002 University of Wisconsin, CS 559 Last Time 2D Coordinate systems and transformations.
CS559: Computer Graphics Lecture 9: Rasterization Li Zhang Spring 2008.
OpenGL The Viewing Pipeline: Definition: a series of operations that are applied to the OpenGL matrices, in order to create a 2D representation from 3D.
Basic 3D Concepts. Overview 1.Coordinate systems 2.Transformations 3.Projection 4.Rasterization.
Basic Perspective Projection Watt Section 5.2, some typos Define a focal distance, d, and shift the origin to be at that distance (note d is negative)
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Three-Dimensional Viewing Hearn & Baker Chapter 7
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 5: Viewing
Taxonomy of Projections FVFHP Figure Taxonomy of Projections.
Lecture 5: Introduction to 3D
A Photograph of two papers
Viewing and Projection
Coordinate Systems Lecture 1 Fri, Sep 2, The Coordinate Systems The points we create are transformed through a series of coordinate systems before.
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Viewing and Projection. The topics Interior parameters Projection type Field of view Clipping Frustum… Exterior parameters Camera position Camera orientation.
3D GRAPHICS RENDERING PIPELINE CS / TECHNICAL BACKGROUND PAGE 11.
CS 551 / 645: Introductory Computer Graphics Viewing Transforms.
CS5500 Computer Graphics March 20, Computer Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Computer Viewing Isaac Gang University of Mary Hardin-Baylor.
Viewing. Classical Viewing Viewing requires three basic elements - One or more objects - A viewer with a projection surface - Projectors that go from.
CS 490: Computer Graphics Chapter 5: Viewing. Interactive Computer GraphicsChapter Overview Specifying the viewpoint Specifying the projection Types.
A Photograph of two papers The Model: 2 papers – 8cm x 8cm and 5cm x 5cm The Camera – Simple pinhole – No focusing capability The Scene – Arrangements.
Introduction to Computer Graphics
Rendering Pipeline Fall, 2015.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016
CSE 167 [Win 17], Lecture 5: Viewing Ravi Ramamoorthi
CSCE 441 Computer Graphics 3-D Viewing
CENG 477 Introduction to Computer Graphics
Viewing/Projections I Week 3, Fri Jan 25
A Photograph of two papers
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016
Computer Graphics Imaging
Computer Graphics (Spring 2003)
Projection in 3-D Glenn G. Chappell
Chapter V Vertex Processing
Last Time Canonical view pipeline Projection Local Coordinate Space
Viewing (Projections)
Viewing (Projections)
Computer Graphics Computer Viewing
Maps one figure onto another figure in a plane.
Presentation transcript:

CS 450: COMPUTER GRAPHICS PROJECTIONS SPRING 2015 DR. MICHAEL J. REALE

TRANSFORMS IN REVIEW Model and view transform are AFFINE transformations (parallel lines stay parallel) Model transform  any kind of transformation we’ve seen so far Rotation, scaling, translation, shear, etc. View transform  translation followed by rotation Centers camera at origin and orients it to look down –z axis Projection transform  depends on which we use Orthographic  affine Perspective  NOT affine  affects w component!

PROJECTION APPROACHES One can approach projection in one of two ways: Transform x and y, but zero out z component  flattening to a 2D plane Not invertible (can’t get z information back) Doesn’t help us if we’re using z buffers Doesn’t restrict which points in z we want (usually want to avoid points BEHIND camera) Transform camera volume into unit volume Gives us near and far planes  limits which range of z coordinates we allow Preserves z information (although it does transform it) Remember: from here on out, we are assuming that we have performed the view transform and we are already looking down the –z axis Either way, output will be normalized device coordinates

ORTHOGRAPHIC PROJECTION

INTRODUCTION Orthographic projection Parallel lines stay parallel  affine transformation Does not affect w component

FLATTENING TO A PLANE Simple example of flattening to a plane:

USING A VIEW VOLUME Define Axis-Aligned Bounding Box (AABB) with 6 values: left, right, bottom, top, near, far Goes from (l,b,n) to (r,t,f) Points to render must be inside AABB Near plane, far plane = extents of z values Transform AABB to unit cube Translation, then scale Makes clipping more efficient OpenGL  (-1,-1,-1) to (1,1,1)

FLIPPING Z Technically, because we’re looking down NEGATVE z axis  near > far! Often switch to LEFT-handed coordinate system by using reflection matrix before projection Looking down POSITIVE z axis Then, specify near and far values with 0 < n’ < f’ (positive z values)

PERSPECTIVE PROJECTION

INTRODUCTION Perspective projection NOT affine  parallel lines are generally NOT parallel after projection Lines may converge to a single point Matches more closely how we see things in real life (farther away = looks smaller)  more commonly used

FLATTENING TO A PLANE Let’s say we have a plane z = -d, d > 0 Camera is at origin We want to project a point p onto the plane z = -d, giving us a new point q = (q x, q y, -d) Using similar triangles, we can get the new x and y components:

FLATTENING TO A PLANE The corresponding perspective projection matrix is given by: NOTICE: The last row isn’t just (0,0,0,1) anymore!  will alter point’s w coordinate  must divide vector by w!

USING A VIEW VOLUME The view volume (or frustum) of a perspective projection is defined a little differently: Near and far plane (Left, bottom) and (right, top) corners of NEAR plane

PERSPECTIVE PROJECTION MATRIX The perspective projection matrix is given by: Example: point already at near plane:

FLIPPING Z Same as with the orthographic projection, z can be flipped before projection After that, use 0 < n’ < f’ OpenGL matrix with flipping:

FIELD OF VIEW Often can define horizontal and vertical field of view (FOV) angles Too wide  see distortion on edges (fish-eye lens effect) Too narrow  everything very “zoomed in” Can compute horizontal FOV based on w = width of monitor and d = distance from user: Asymmetric frustums = where either r != -l or t != -b  used in stereo viewing

EFFECTS OF FOV FOV = 109° FOV = 70° FOV = 30°

EFFECT ON Z VALUE With perspective projection  resulting z values do NOT vary linearly with input p z value! Placement of near and far planes  affects precision of z buffer! Example: abs(f – n) = 100, varying how close near plane is to camera: