Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Chapter 15: Working with the Camera.

Slides:



Advertisements
Similar presentations
2D Geometric Transformations
Advertisements

Camera Models A camera is a mapping between the 3D world and a 2D image The principal camera of interest is central projection.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Transformations II Week.
CMPE 466 COMPUTER GRAPHICS
CS485/685 Computer Vision Prof. George Bebis
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 14 Chapter 14: The Camera.
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.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 3 Chapter 3: Simple Graphics Program.
3D Computer Vision and Video Computing 3D Vision Lecture 14 Stereo Vision (I) CSC 59866CD Fall 2004 Zhigang Zhu, NAC 8/203A
Rotations and Translations. Representing a Point 3D A tri-dimensional point A is a reference coordinate system here.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 11 Chapter 11: Hierarchical Modeling.
TA: Zhicheng Yan Sushma S Kini Mary Pietrowicz
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 4 Chapter 4: Working with Graphics APIs.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 8 Chapter 8: Transformation Operators.
Another Look at Camera Control
2D Transformations. World Coordinates Translate Rotate Scale Viewport Transforms Hierarchical Model Transforms Putting it all together.
CS 450: Computer Graphics 2D TRANSFORMATIONS
3D Rendering with JOGL Introduction to Java OpenGL Graphic Library By Ricardo Veguilla
Basic Manipulations / Transformations Nomar Arredondo & Michael Sexstella B L E N D 3 RB L E N D 3 R With There’s SPARKY!!
Introduction to 3D Graphics Lecture 3: General Camera Model Anthony Steed University College London.
C O M P U T E R G R A P H I C S Stuff CMSC 435 / 634 Transformations 1/29 Geometric Transformations Readings: Chapters 5-6.
CS 480/680 Computer Graphics Representation Dr. Frederick C Harris, Jr. Fall 2012.
Programming Alice Alice is named in honor of Lewis Carroll’s Alice in Wonderland.
1 Another Look at Camera Control Karan Singh †, Cindy Grimm, Nisha Sudarsanan Media and Machines Lab Department of Computer Science and Engineering Washington.
Computer Graphics World, View and Projection Matrices CO2409 Computer Graphics Week 8.
MIT EECS 6.837, Durand and Cutler Graphics Pipeline: Projective Transformations.
CS 376 Introduction to Computer Graphics 02 / 16 / 2007 Instructor: Michael Eckmann.
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.
Transformations Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Jinxiang Chai Composite Transformations and Forward Kinematics 0.
Geometric Objects and Transformation
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 5 Chapter 5: MVC Architecture.
Viewing CS418 Computer Graphics John C. Hart. Graphics Pipeline Homogeneous Divide Model Coords Model Xform World Coords Viewing Xform Still Clip Coords.
SE 313 – Computer Graphics Lecture 8: Transformations and Projections Lecturer: Gazihan Alankuş 1.
Geometrical Transformations 2 Adapted from Fundamentals of Interactive Computer Graphics, Foley and van Dam, pp , by Geb Thomas.
Geometric Transformations Hearn & Baker Chapter 5 Some slides are taken from Robert Thomsons notes.
Business and Computing Deanery 3D Modelling Tools Week 14 – Animating cameras.
Three-Dimensional Viewing
Navigating in 3D MAX CTEC V part 1. Viewing Objects and/or Scenes Depending upon the software program, the image on the monitor could be a Perspective.
Computer vision: models, learning and inference M Ahad Multiple Cameras
University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell Hierarchical Modeling.
A Photograph of two papers
Computer Graphics Matrices
Honours Graphics 2008 Session 2. Today’s focus Vectors, matrices and associated math Transformations and concatenation 3D space.
Lecture 7 Midterm Review. OpenGL Libraries gl: Basic OpenGL library, e.g. primitives. glu: OpenGL Utility library, a set of functions to create texture.
Digital Image Processing Additional Material : Imaging Geometry 11 September 2006 Digital Image Processing Additional Material : Imaging Geometry 11 September.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 9 Chapter 9: Combining Transformation Operators.
Composite 3D Transformations. Example of Composite 3D Transformations Try to transform the line segments P 1 P 2 and P 1 P 3 from their start position.
Transformation. 3D Transformation oIn the modeling lecture we saw how to define an object in terms of its vertices in object space oWe will now see how.
Computer Graphics I, Fall 2010 Transformations.
CS 551 / 645: Introductory Computer Graphics Viewing Transforms.
CS 325 Introduction to Computer Graphics 02 / 19 / 2010 Instructor: Michael Eckmann.
Lec 26: Fundamental Matrix CS4670 / 5670: Computer Vision Kavita Bala.
Build your own 2D Game Engine and Create Great Web Games using HTML5, JavaScript, and WebGL. Sung, Pavleas, Arnez, and Pace, Chapter 7 Manipulating.
Computer Graphic 2 D Transformation.
Forward Projection Pipeline and Transformations CENG 477 Introduction to Computer Graphics.
Geometric Transformations Hearn & Baker Chapter 5
3D Geometric Transformations
Chapter 3 Drawing In the World.
Modeling 101 For the moment assume that all geometry consists of points, lines and faces Line: A segment between two endpoints Face: A planar area bounded.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016
Manipulating the Camera
Transformations 3 University of British Columbia
Hierarchical Modeling
Chapter 13: A Simple 3D Application Chapter 13.
Viewing/Projections I Week 3, Fri Jan 25
Hierarchical Modeling
Presentation transcript:

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Chapter 15: Working with the Camera

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 This Chapter: we will learn about One example of implementing Computer Graphics Camera Working with multiple Cameras Examples of interactive camera manipulation Select primitive in 3D scenes

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Changes to Library: 2D to 3D No changes: Primitive: 2D primitives drawn in 3D SceneNode: continue to load M W Matrix Model: continue to be application main class Changes: WindowHandler When loading matrices!

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 WindowHandler: 2D vs 3D

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Lib14: Support for 3D New classes: Camera PrimitiveAxisFrame: Drawing x,y,z axis frame Modifications: WindowHandler Support Camera Load View and Projection Matrices XformInfo Support 3D rotation

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Lib14: New Classes and Changes

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

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Lib14: WindowHandler changes

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Lib14: XformInfo Changes Xform Operator in 2D Scale, Translate, Pivot: all 3D quantity Problem: Rotation: θ rotates wrt to z-axis! Xform Operator in 3D (for now) Rotation: (θ x θ y θ z ) Three rotations with respect to each axes

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Lib14: XformInfo details … Xform Operator:

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Tut 15.1: Working with Lib14 Using: Camera and WindowHandler

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Tut 15.1: WindowHandler details

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Lib14: D3D_WindowHandler

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Tut 15.1: DrawHandler

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Tut 15.1: Application CTutorialDlg

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Tut 15.2: Working with 2 Cameras CTutorialDlg class

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Interactive Manipulation of Camera Parameters under explicit user control Camera position Look at position Parameters implicitly controlled Up Vector: try to maintain sense of “up” Parameters typically not controlled Near/Far planes (no real-world correspondence) FOV – zooming control via camera position movement

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Notation and Terminology

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Tut 15.3: Camera Manipulation with the Mouse Left Mouse Button (LMB) Orbit Middle (MMB) Pan Right (RMB) Zoom

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 LMB: Tumble or Orbit the Camera

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Left/Right Orbiting Axis of rotation: The “Up” Direction

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Up/Down Orbiting Axis or rotation: Side Vector

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Orbit: Idea Orbit or Rotate Need Matrix: Camera Position:

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Orbit: Alternatively

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Orbit: Implementation Rotate the World when compute M V Instead of: Compute: Compute and load:

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Lib14: Orbit Support Camera: mouse movement to radians And … using in WindowHandler

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Lib14: Using camera orbit info In WindowHandler:: ComputeViewMatrix

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 MMB: Pan or Track the camera

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Vertical Tracking: (Along UpVector)

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Tracking: Implementation Horizontal/Vertical mouse movements dx and dy Computer Movement vector: Left/Right tracking: along side-vector Up/down tracking: along up-vector Update both camera and at positions:

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Lib14: Tracking Support Camera Class:

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 RMB: Dolly or Zoom the Camera

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Zoom: Implementation Mouse movement: d Move camera eye position in the viewing direction! Watch out!

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Lib14: Mouse Zoom support Camera class

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Drawing the Camera Requires at least two Views! View-A cannot draw the camera of View-A! Can only draw the camera for another view! i.e., View-A draws camera of View-B

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Drawing camera: View Matrix Details Recall: for “orbiting”, we computed and loaded M V with: To properly draw camera-B, from view-A Include camera-B orbiting! Un-do view-A’s camera orbiting ( )

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Implementation: Load into the WORLD matrix

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 3D DC to WC Transformation Must: DC  NDC  EC  WC

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Transform: DC to NDC Assume Recall: Or: In 3D:

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 DC Points and NDC Ray

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 NDC Ray to EC Ray Transform

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 NDC  EC If: In general: or: Given: Then:

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Reconstruct the ray in EC: Given: In general, NDC Point: is a line in EC: Or:

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 EC to WC Transform: Given: Choose convenient z e values z e = 0 and z e = 1 Use to compute WC positions:

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Tut 15.4: Mouse Click to WC Shift-LMB to see the selection ray

Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Chapter 15 Tut 15.4: Device to WC Xform