2 COEN 290 - Computer Graphics I Evening’s Goals n Discuss the mathematical transformations that are utilized for computer graphics projection viewing.

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.
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 2005 Tamara Munzner Projections II Week 4,
HCI 530 : Seminar (HCI) Damian Schofield. HCI 530: Seminar (HCI) Transforms –Two Dimensional –Three Dimensional The Graphics Pipeline.
Projection Matrices CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Viewing and Projections
Projection Matrices Ed Angel
Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 5: Viewing
CS485/685 Computer Vision Prof. George Bebis
Viewing Doug James’ CG Slides, Rich Riesenfeld’s CG Slides, Shirley, Fundamentals of Computer Graphics, Chap 7 Wen-Chieh (Steve) Lin Institute of Multimedia.
4.1si31_2001 SI31 Advanced Computer Graphics AGR Lecture 4 Projection Clipping Viewport Transformation.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Viewing and Projections Mon 22 Sep 2003 project 1 solution demo recap: projections.
OpenGL (II). How to Draw a 3-D object on Screen?
CS 4731: Computer Graphics Lecture 11: 3D Viewing Emmanuel Agu.
Introduction to OpenGL Pipeline From Programmer View Tong-Yee Lee.
Informationsteknologi Wednesday, November 14, 2007Computer Graphics - Class 81 Today’s class Orthogonal matrices Quaternions Shears Synthetic camera Viewing.
Projection Projection - the transformation of points from a coordinate system in n dimensions to a coordinate system in m dimensions where m
2/26/04© University of Wisconsin, CS559 Spring 2004 Last Time General Orthographic Viewing –Specifying cameras in world coordinates –Building world  view.
Introduction to 3D viewing 3D is just like taking a photograph!
12.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 12 – 3D Graphics Transformation Pipeline: Projection and Clipping.
Viewing and Projections
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.
Homogeneous Coordinates (Projective Space) Let be a point in Euclidean space Change to homogeneous coordinates: Defined up to scale: Can go back to non-homogeneous.
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.
2/24/04© University of Wisconsin, CS559 Spring 2004 Last Time 3D Transformations –Most are natural extensions of 2D transforms –Rotations can be represented.
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.
CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 5.
CAP4730: Computational Structures in Computer Graphics 3D Transformations.
1 Computer Graphics Week9 -3D Geometric Transformation.
Programming 3D Applications CE Displaying Computer Graphics Week 3 Lecture 5 Bob Hobbs Faculty of Computing, Engineering and Technology Staffordshire.
CS 4731: Computer Graphics Lecture 13: Projection Emmanuel Agu.
CS 450: COMPUTER GRAPHICS PROJECTIONS SPRING 2015 DR. MICHAEL J. REALE.
Computer Graphics Zhen Jiang West Chester University.
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 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)
2 COEN Computer Graphics I Evening’s Goals n Discuss viewing and modeling transformations n Describe matrix stacks and their uses n Show basic geometric.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Jinxiang Chai CSCE 441 Computer Graphics 3-D Viewing 0.
Three-Dimensional Viewing Hearn & Baker Chapter 7
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 5: Viewing
Rendering Pipeline Fall, D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.
Taxonomy of Projections FVFHP Figure Taxonomy of Projections.
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.
Viewing and Projection. The topics Interior parameters Projection type Field of view Clipping Frustum… Exterior parameters Camera position Camera orientation.
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.
OpenGL LAB III.
Viewing. Classical Viewing Viewing requires three basic elements - One or more objects - A viewer with a projection surface - Projectors that go from.
Outline 3D Viewing Required readings: HB 10-1 to 10-10
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.
CSE 167 [Win 17], Lecture 5: Viewing Ravi Ramamoorthi
CSCE 441 Computer Graphics 3-D Viewing
A Photograph of two papers
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University View & Projection.
Computer Graphics (Spring 2003)
Projection in 3-D Glenn G. Chappell
Projections and Hidden Surface Removal
Chapter V Vertex Processing
Last Time Canonical view pipeline Projection Local Coordinate Space
Chap 3 Viewing Pipeline Reading:
Interactive Computer Graphics Viewing
THREE-DIMENSIONAL VIEWING II
THREE-DIMENSIONAL VIEWING
Presentation transcript:

2 COEN Computer Graphics I Evening’s Goals n Discuss the mathematical transformations that are utilized for computer graphics projection viewing modeling n Describe aspect ratio and its importance n Provide a motivation for homogenous coordinates and their uses

3 COEN Computer Graphics I Mathematical Transformations n Use transformations for moving from one coordinate space to another n The good news only requires multiplication and addition n The bad news its multiplication and addition of matrices

4 COEN Computer Graphics I Mathematical Transformations ( cont. ) n Coordinate spaces we’ll be using model world eye normalized device ( NDC’s ) window screen viewport

5 COEN Computer Graphics I Simplified 2D Transform Pipeline n What if your data is not in viewport coordinates? World Coordinates Date Stock Price Viewport coordinates ???

6 COEN Computer Graphics I Simplified 2D Transform Pipeline ( cont. ) n Need to map world to viewport coordinates n Simple linear transformation linear transformations can be represented by matrices

7 COEN Computer Graphics I Almost, but not quite n The 2x2 matrix isn’t quite enough to do the whole job think about trying to map a point like (10,10) into the (0,0) n Enter … homogenous coordinates add an additional “dimension” to your coordinate vector

8 COEN Computer Graphics I Determining the Matrix Entries n Matrix forms of linear transforms are shorthand for an “line” equation n So what we need is to determine what equations we want to write as matrices

9 COEN Computer Graphics I Mapping World to Viewport Coordinates Viewport coordinates ??? World Coordinates Date Stock Price

10 COEN Computer Graphics I Or as a Matrix n Let then our matrix becomes

11 COEN Computer Graphics I Setting up OpenGL’s 2D world n OpenGL will do this automatically for us gluOrtho2D( xMin, xMax, yMin, yMax ); n However, it doesn’t do it quite as we described first maps world coordinates into normalized device coordinates ( NDC ) then maps from NDC’s to viewport coordinates

12 COEN Computer Graphics I Normalized Device Coordinates n Map each dimension linearly into sometimes mapped to n Simplifies several things clipping –don’t need to know viewport for clipping describes a device independent space –no concerns about resolution, etc. more things which we’ll get to in a minute –very useful when we’re in 3D

13 COEN Computer Graphics I Putting it all together World Coordinates Date Stock Price Date Stock Price NDC Date Stock Price Viewport Coordinates

14 COEN Computer Graphics I Err … something doesn’t look right n Need to match aspect ratio n Aspect ratios of different coordinate spaces need to match

15 COEN Computer Graphics I What’s different for 3D n Add another dimension n Our transformation matrices become 4x4 n More options for our projection transform

16 COEN Computer Graphics I Where we’re at n What our transformation pipeline looks like so far... viewportNDC’sWorld This is really called a projection transform

17 COEN Computer Graphics I Projection Transformations n Map coordinates into NDC’s n Defines our viewing frustum sets the position of our imaging plane n Two types for 3D Orthographic (or parallel) Projection –gluOrtho2D() Perspective Projection

18 COEN Computer Graphics I A Few Definitions First … n A viewing frustum is the region in space in which objects can be seen All of the visible objects in our scene will be in the viewing frustum n The imaging plane is a plane in space onto which we project our scene viewing frustum controls where the imaging plane is located

19 COEN Computer Graphics I Orthographic Projections n Project objects in viewing frustum without distortion good for computer aided engineering and design –preserves angles and relative sizes

20 COEN Computer Graphics I Orthographic Projections ( cont. )

21 COEN Computer Graphics I Defining an Orthographic Projection n Very similar to mapping 2D to NDC’s n Use OpenGL’s glOrtho( l, r, b, t, n, f );

22 COEN Computer Graphics I Perspective Projections n Model how the eye sees objects farther from the eye are smaller n A few assumptions eye is positioned at the world space origin looking down the world -z axis n Clipping plane restrictions

23 COEN Computer Graphics I Perspective Projections ( cont. ) n Based on similar triangles y z n

24 COEN Computer Graphics I Perspective Projections ( cont. ) n Viewing frustum looks like a truncated Egyptian pyramid

25 COEN Computer Graphics I Defining Perspective Projections n Two OpenGL versions glFrustum( l, r, b, t, n, f ); –frustum not necessarily aligned down line of sight –good for simulating peripheral vision gluPerspective ( fovy, aspect, n, f ); –frustum centered down line of sight –more general form –reasonable values: –aspect should match aspect ratio of viewport

26 COEN Computer Graphics I Defining a Perspective Projection glFrustum( l, r, b, t, n, f );

27 COEN Computer Graphics I Defining a Perspective Projection ( cont. ) gluPerspective ( fovy, aspect, n, f ); then use glFrustum()

28 COEN Computer Graphics I Clipping in 3D n Projections transforms make clipping easy n Use your favorite algorithm n Clipping region well defined

29 COEN Computer Graphics I Normalizing Projected Coordinates n w is a scaling factor n Perspective divide divide each coordinate by w maps into NDC’s What about z?