Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 Chapter 14: The Camera.

Slides:



Advertisements
Similar presentations
Defining the Viewing Coordinate System
Advertisements

Three Dimensional Viewing
1 Computer Graphics Chapter 8 3D Transformations.
Structure from motion.
Based on slides created by Edward Angel
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Computer Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 5: Viewing
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 8 Views.
Chapter 10: Coordinate Systems Chapter 10.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 12 Chapter 12: Making the Applications Interesting.
Lecture 3 – Transformation And Coordinate Systems
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner Viewing/Projections I.
4.1si31_2001 SI31 Advanced Computer Graphics AGR Lecture 4 Projection Clipping Viewport Transformation.
OpenGL (II). How to Draw a 3-D object on Screen?
CS 4731: Computer Graphics Lecture 11: 3D Viewing Emmanuel Agu.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Chapter 8: Transformation Operators.
Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by Greg Humphreys)
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
Computer Graphics (fall 2009)
The Viewing Pipeline (Chapter 4) 5/26/ Overview OpenGL viewing pipeline: OpenGL viewing pipeline: – Modelview matrix – Projection matrix Parallel.
Week 2 - Wednesday CS361.
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.
2/24/04© University of Wisconsin, CS559 Spring 2004 Last Time 3D Transformations –Most are natural extensions of 2D transforms –Rotations can be represented.
Graphics Graphics Korea University cgvr.korea.ac.kr 3D Viewing 고려대학교 컴퓨터 그래픽스 연구실.
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.
Geometric Camera Models
10/3/02 (c) 2002 University of Wisconsin, CS 559 Last Time 2D Coordinate systems and transformations.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Chapter 15: Working with the Camera.
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.
Chapters 5 2 March Classical & Computer Viewing Same elements –objects –viewer –projectors –projection plane.
Three-Dimensional Viewing Hearn & Baker Chapter 7
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 5: Viewing
©2005, Lee Iverson Lee Iverson UBC Dept. of ECE EECE 478 Viewing and Projection.
Rendering Pipeline Fall, D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.
Classical Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Taxonomy of Projections FVFHP Figure Taxonomy of Projections.
Viewing and Projection
A Photograph of two papers
Coordinate Systems Lecture 1 Fri, Sep 2, The Coordinate Systems The points we create are transformed through a series of coordinate systems before.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Chapter 9: Combining Transformation Operators.
CS-321 Dr. Mark L. Hornick 1 Three-Dimensional Graphics Problem How can you effectively display 3-D information on a 2-D display?
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.
Orthonormal Basis Cartesian Coordinate System – Unit vectors: i, j, k – Normalized to each other – Unique representation for each position!! – Convenient!
CS 551 / 645: Introductory Computer Graphics Viewing Transforms.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Computer Viewing Isaac Gang University of Mary Hardin-Baylor.
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.
Three Dimensional Viewing
Rendering Pipeline Fall, 2015.
CSE 167 [Win 17], Lecture 5: Viewing Ravi Ramamoorthi
3D Viewing cgvr.korea.ac.kr.
CSCE 441 Computer Graphics 3-D Viewing
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016
3D Clipping.
A Photograph of two papers
Three Dimensional Viewing
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University View & Projection.
Chapter V Vertex Processing
Viewing (Projections)
Viewing (Projections)
Presentation transcript:

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 Chapter 14: The Camera

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 This Chapter: we will learn about Requirements of a Computer Graphics Camera Visible Volumes Perspective vs Orthorgraphics Coordinate Systems Eye (Camera) Coordinate System 3D Normalized Device Coordinate System 3D to 2D Perspective Projection

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 A Computer Graphics Camera Camera position Look at position Up direction Related terms: Image Plane Viewing Direction View Vector

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 The Up Direction (Up Vector): Also referred to as: Twist Angle Cannot be parallel to viewing direction Does not need to be normalized Does not need to be perpendicular to viewing direction

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 Tut 14.1: Viewing Parameters All viewing parameters controlled by slider bars

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 z=slider: Twist angle: not perpendicular to View Vector! Tut 14.1: Controlling the Up Vector

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 The Visible Volume Only geometries (primitives) inside the volume are visible All geometries (primitives) outside are ignored Primitives straddle the volume are Clipped!

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 The Rectangular Visible Volume Volume defined by: Near Plane (n) Far Plane (f) Width (W) Height (H) For Orthographic Projection

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 Tut 14.2: Rectangular Visible Volume Experiment with Rectangular Visible Volume

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 Tut 14.2: Orthographic Projection

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 The Viewing Frustum Volume Volume defined by: Near Plane (n) Far Plane (f) Fields of view (fov) For Orthographic Projection

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 Near Plane and Aspect Ratio Aspect Ratio Near Plane Height (n h ) Width (n w )

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 Tut 14.3: Viewing Frustum Experiment with Viewing Frustum

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 Tut 14.3: Perspective Projection

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 Orthographic vs Perspective Projection Orthographic Projection Parallel projection Preserve size Good for determining relative size Perspective Projection Projection along rays Closer objects appears larger Human vision! Only work with: Perspective Projection

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 Near-to-Far Plane distance Fixed number of bits to resolve distance E.g.: 16-bits: Unique positions: If (f-n)=18: resolve distances larger than: If (f-n) = 10 6 : resolve distance larger than: Rule of Thumb: Minimize f and maximize n f-n – As tight as possible

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 Tut 14.4: Near/Far Distance Two squares very close to each other: Set n/f values to see errors!!

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 Coordinate Transformation Pipeline Recall: Transforms World Transform (M W ) Object Space (OC) To World Space (WC) View Transform (M V ) WC to Eye (Camera) Space (EC) Projection Transform (M P ) EC To NDC (Normalize Device)

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 The M W : World Transform Transformation: From Object Space to World Space Identical to 2D! Refer to discussions: In Chapter 11: World Coordinate System Library Implementation: SceneNode’s Transform operator! DrawHelper: Matrix Stack Manipulations!

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 The M V : View Transform Transformation From World to Eye Space Referred to as: Eye, or View, or Camera Transform Topics: Eye Coordinate Orthonormal Basis The Eye Coordinate (EC) Space Aligning EC and WC Orthonormal Basis The WC to EC Transform

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 The EC Orthonormal Basis Viewing Parameters: Eye Position At Position Up Vector View Vector Side Vector Adjusted Up Vector:

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 Example:

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 The Eye Coordinate Space Origin: eye position Axes Directions View: -z Up: y Side: x Visible Volume Near: z=-n Far: z=-f

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 Align EC and WC Orthonormal Basis

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 M V : M w2e WC To EC Transform

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 Inverse Transform: M e2w Row-4 is: The Eye Position!!

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 The M P : Projection Transform Transform from EC to NDC Recall NDC Range: Transform: Squeeze the View Frustum into NDC Cube

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 View Frustum to NDC Cube

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 3D NDC to 2D Image (Near) Plane Resulting image on the near plane

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 Re-Examine Tutorial 13.1 GrfxWindow::OnPaint()