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.

Slides:



Advertisements
Similar presentations
Computer Graphics - Viewing -
Advertisements

CS-378: Game Technology Lecture #1: Scan Conversion Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,
Three Dimensional Viewing
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.
Part I: Basics of Computer Graphics Viewing Transformation and Coordinate Systems Chapter
Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 5: Viewing
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.
CS223b, Jana Kosecka Rigid Body Motion and Image Formation.
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.
Cameras, lenses, and calibration
CHAPTER 7 Viewing and Transformations © 2008 Cengage Learning EMEA.
Projection Projection - the transformation of points from a coordinate system in n dimensions to a coordinate system in m dimensions where m
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.
Transformation & Projection Feng Yu Proseminar Computer Graphics :
MIT EECS 6.837, Durand and Cutler Graphics Pipeline: Projective Transformations.
CS559: Computer Graphics Lecture 9: Projection Li Zhang Spring 2008.
Graphics Graphics Korea University cgvr.korea.ac.kr 3D Viewing 고려대학교 컴퓨터 그래픽스 연구실.
Computer Graphics Bing-Yu Chen National Taiwan University.
CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 5.
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.
CS-378: Game Technology Lecture #2.2: Clipping and Hidden Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney,
Viewing CS418 Computer Graphics John C. Hart. Graphics Pipeline Homogeneous Divide Model Coords Model Xform World Coords Viewing Xform Still Clip Coords.
CS559: Computer Graphics Lecture 9: Rasterization Li Zhang Spring 2008.
CS 325 Introduction to Computer Graphics 02 / 22 / 2010 Instructor: Michael Eckmann.
CS 450: COMPUTER GRAPHICS PROJECTIONS SPRING 2015 DR. MICHAEL J. REALE.
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.
University of North Carolina at Greensboro
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)
Computer Graphics Lecture 08 Fasih ur Rehman. Last Class Ray Tracing.
Jinxiang Chai CSCE 441 Computer Graphics 3-D Viewing 0.
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 5: Viewing
2/19/04© University of Wisconsin, CS559 Spring 2004 Last Time Painterly rendering 2D Transformations –Transformations as coordinate system changes –Transformations.
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Classical Viewing Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Rendering Pipeline Fall, D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.
Taxonomy of Projections FVFHP Figure Taxonomy of Projections.
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.
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
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.
CS 551 / 645: Introductory Computer Graphics Viewing Transforms.
Viewing Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
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
Computer Graphics Projections.
PROJECTIONS PROJECTIONS 1. Transform 3D objects on to a 2D plane using projections 2 types of projections Perspective Parallel In parallel projection,
3D Viewing and Clipping Ming Ouhyoung 歐陽明 Professor Dept. of CSIE and GINM NTU.
CS682, Jana Kosecka Rigid Body Motion and Image Formation Jana Kosecka
Chapter 11 Three-Dimensional Geometric and Modeling Transformations
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016
University of North Carolina at Greensboro
3D Viewing cgvr.korea.ac.kr.
Graphics Fundamentals
CSCE 441 Computer Graphics 3-D Viewing
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.
CENG 477 Introduction to Computer Graphics
Viewing/Projections I Week 3, Fri Jan 25
Three Dimensional Viewing
Computer Graphics (Spring 2003)
Last Time Canonical view pipeline Projection Local Coordinate Space
3D Graphics.
Viewing (Projections)
Viewing (Projections)
Presentation transcript:

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 Hodgins V

2 Today Windowing and Viewing Transformations Windows and viewports Orthographic projection Perspective projection

3 Screen Space Monitor has some number of pixels e.g x 768 Some sub-region used for given program You call it a window Let’s call it a viewport instead

4 Screen Space May not really be a “screen” Image file Printer Other Little pixel details Sometimes odd Upside down Hexagonal From Shirley textbook.

5 Screen Space Viewport is somewhere on screen You probably don’t care where Window System likely manages this detail Sometimes you care exactly where Viewport has a size in pixels Sometimes you care (images, text, etc.) Sometimes you don’t (using high-level library)

6 Canonical View Space Canonical view region 2D: [-1,-1] to [+1,+1] From Shirley textbook.

7 Canonical View Space Canonical view region 2D: [-1,-1] to [+1,+1] From Shirley textbook.

8 Canonical View Space Canonical view region 2D: [-1,-1] to [+1,+1] Define arbitrary window and define objects Transform window to canonical region Do other things (we’ll see clipping latter) Transform canonical to screen space Draw it.

9 Canonical View Space World CoordinatesCanonicalScreen Space (Meters)(Pixels) Note distortion issues...

10 Projection Process of going from 3D to 2D Studies throughout history (e.g. painters) Different types of projection Linear Orthographic Perspective Nonlinear Orthographic is special case of perspective... Many special cases in books just one of these two...

11 Linear Projection Projection onto a planar surface Projection directions either Converge to a point Are parallel (converge at infinity)

12 Linear Projection A 2D view

13 Linear Projection Orthographic Perspective

14 Linear Projection Orthographic Perspective

15 Linear Projection A 2D view

16 Orthographic Projection No foreshortening Parallel lines stay parallel Poor depth cues

17 Canonical View Space Canonical view region 3D: [-1,-1,-1] to [+1,+1,+1] Assume looking down -Z axis Recall that “Z is in your face”

18 Orthographic Projection Convert arbitrary view volume to canonical

19 Orthographic Projection

20 Orthographic Projection Step 1: translate center to origin

21 Orthographic Projection Step 1: translate center to origin Step 2: rotate view to -Z and up to +Y

22 Orthographic Projection Step 1: translate center to origin Step 2: rotate view to -Z and up to +Y Step 3: center view volume

23 Orthographic Projection Step 1: translate center to origin Step 2: rotate view to -Z and up to +Y Step 3: center view volume Step 4: scale to canonical size

24 Orthographic Projection Step 1: translate center to origin Step 2: rotate view to -Z and up to +Y Step 3: center view volume Step 4: scale to canonical size

25 Perspective Projection Foreshortening: further objects appear smaller Some parallel line stay parallel, most don’t Lines still look like lines Z ordering preserved (where we care)

26 Perspective Projection Pinhole a.k.a center of projection Image from D. Forsyth

27 Perspective Projection Foreshortening: distant objects appear smaller Image from D. Forsyth

28 Perspective Projection Vanishing points Depend on the scene Not intrinsic to camera “One point perspective”

29 Perspective Projection Vanishing points Depend on the scene Nor intrinsic to camera “Two point perspective”

30 Perspective Projection Vanishing points Depend on the scene Not intrinsic to camera “Three point perspective”

31 Perspective Projection View Frustum

32 Perspective Projection

33 Perspective Projection Step 1: Translate center to origin

34 Perspective Projection Step 1: Translate center to origin Step 2: Rotate view to -Z, up to +Y

35 Perspective Projection Step 1: Translate center to origin Step 2: Rotate view to -Z, up to +Y Step 3: Shear center-line to -Z axis

36 Perspective Projection Step 1: Translate center to origin Step 2: Rotate view to -Z, up to +Y Step 3: Shear center-line to -Z axis Step 4: Perspective

37 Perspective Projection Step 4: Perspective Points at z=-i stay at z=-i Points at z=-f stay at z=-f Points at z=0 goto z=±∞ Points at z=-∞ goto z=-(i+f) x and y values divided by -z/i Straight lines stay straight Depth ordering preserved in [ -i,-f ] Movement along lines distorted

38 From Shirley textbook. Perspective Projection WRONG!

39 Perspective Projection “Eye” plane Top NearFar Some horizontal lines View vector

40 Perspective Projection Visualizing division of x and y but not z

41 Perspective Projection Motion in x,y

42 Perspective Projection Note that points on near plane fixed

43 Perspective Projection Recall that points on far plane will stay there...

44 Perspective Projection When we also divide z points must remain on straight lines

45 Perspective Projection Lines extend outside view volume

46 Perspective Projection Motion in z

47 Perspective Projection Motion in z

48 Perspective Projection Motion in z

49 Perspective Projection Total motion

50 Perspective Projection Step 1: Translate center to orange Step 2: Rotate view to -Z, up to +Y Step 3: Shear center-line to -Z axis Step 4: Perspective Step 5: center view volume Step 6: scale to canonical size

51 Perspective Projection Step 1: Translate center to orange Step 2: Rotate view to -Z, up to +Y Step 3: Shear center-line to -Z axis Step 4: Perspective Step 5: center view volume Step 6: scale to canonical size

52 Perspective Projection There are other ways to set up the projection matrix View plane at z=0 zero Looking down another axis etc... Functionally equivalent

53 Vanishing Points Consider a ray:

54 Vanishing Points Ignore Z part of matrix X and Y will give location in image plane Assume image plane at z=-i whatever

55 Vanishing Points

56 Vanishing Points Assume

57 Vanishing Points All lines in direction d converge to same point in the image plane -- the vanishing point Every point in plane is a v.p. for some set of lines Lines parallel to image plane ( ) vanish at infinity What’s a horizon?

58 Ray Picking Pick object by picking point on screen Compute ray from pixel coordinates.

59 Ray Picking Transform from World to Screen is: Inverse: What Z value?

60 Ray Picking Recall that: Points at z=-i stay at z=-i Points at z=-f stay at z=-f Depends on screen details, YMMV General idea should translate...

61 Suggested Reading Fundamentals of Computer Graphics by Pete Shirley Chapter 6