I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S 3D Viewing: the Synthetic Camera • Programmer’s reference model for specifying 3D view projection parameters to the computer • General synthetic camera: each package has its own but they are all (nearly) equivalent. Many ways to specify camera parameters, e.g., view direction. PHIGS † Camera, Computer Graphics: Principles and Practice, ch. 6 and 7) 3D Viewing II – position of camera – orientation – field of view (wide angle, normal…) – depth of field (near distance, far distance) – focal distance – tilt of view/film plane (if not normal to view direction, produces oblique projections) – perspective or parallel projection? (camera near objects or an infinite distance away) • CS123 uses a simpler, slightly less powerful model than the book’s – omit tilt of view/film plane, focal distance (blurring) † This package is no longer in use but still has the most general synthetic camera model for perspective and parallel projections. Andries van Dam September 20, 2005 3D Viewing II Andries van Dam September 20, 2005 3D Viewing II 1/22 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S View Volumes Conceptual Model of 3D Viewing Process (for wireframe) • A view volume contains everything visible from the point of view or direction: – what does the camera see? • Conical view volumes: – approximates what eye sees – expensive math (simultaneous quadratics) when clipping objects against cone’s surface • Can approximate with rectangular cone instead (called a frustum ) – works well with a rectangular viewing window – simultaneous linear equations for easy clipping of • Viewport is rectangular area of the screen where a objects against sides scene is rendered – this may or may not fill Window Manager’s window – note: window in computer graphics often means a 2D conical clip rectangle on a 2D world coordinate drawing, and eye perspective viewport is the 2D integer coordinate region of screen view space to which the clipped window contents are volume mapped. Window/viewport terminology considerably predates Window Manager terminology • Viewport and film plane may have different aspect ratios synthetic – viewport mapping specifies what to do if aspect ratios frustum camera differ approximation, view volume Andries van Dam September 20, 2005 3D Viewing II 2/22 Andries van Dam September 20, 2005 3D Viewing II 3/22 1
I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S View Volume (1/2) View Volume (2/2) • We need to know six things about our synthetic • Aspect ratio of the electronic “film:” ratio of width to camera model in order to take a picture height • Height angle: determines how much of the scene we will fit into our view volume; larger height angles fit Up Width more of the scene into the view volume (width angle vector angle determined by height angle and aspect ratio) Look – the greater the angle, the greater the amount of vector perspective distortion Height angle • Front and back clipping planes: limit extent of camera’s view by rendering (parts of) objects lying between them and throwing away everything outside Position Front clipping Back clipping of them plane plane • Optional parameter — Focal length : often used for photorealistic rendering; objects at distance Focal • Position of the camera (from where it’s looking) length from camera rendered in sharp detail, objects • The Look vector specifies in what direction the closer or farther away get blurred; reduction in camera is pointing visibility is continuous • The camera’s Orientation is determined by the Look – your camera won’t be implementing focal length vector and the angle through which the camera is blurring rotated about that vector, i.e., the direction of the Up vector Andries van Dam September 20, 2005 3D Viewing II 4/22 Andries van Dam September 20, 2005 3D Viewing II 5/22 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Position Orientation • Orientation is specified by a point in 3D space • Determining the Position is analogous to a to look at (or a direction to look in) and an angle photographer deciding the vantage point from which of rotation about this direction to shoot a photo • Default (canonical) orientation is looking down • Three degrees of freedom: x , y , and z coordinates in the negative z -axis and up direction pointing 3-space straight up the y -axis • This x , y , z coordinate system is right-handed : if you • In general the camera is located at the origin and open your right hand, align your palm and fingers is looking at an arbitrary point with an arbitrary with the +x axis, and curl your fingers towards the +y up direction axis, your thumb will point along the +z axis y x Up vector - z point to look at ( x’, y’, z’ ) Look vector camera Position z • This is a little abstract…easier formulation? Andries van Dam September 20, 2005 3D Viewing II 6/22 Andries van Dam September 20, 2005 3D Viewing II 7/22 2
I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Look and Up Vectors Aspect Ratio • More concrete way to say the same thing as orientation • Analogous to the size of film used in a camera – soon you’ll learn how to express orientation in terms of • Determines proportion of width to height of image Look and Up vectors displayed on screen • Look Vector • Square viewing window has aspect ratio of 1:1 – the direction the camera is pointing • Movie theater “letterbox” format has aspect ratio of – three degrees of freedom; can be any vector in 3-space 2:1 • Up Vector • NTSC television has an aspect ratio of 4:3, and – determines how the camera is rotated around the Look HDTV is 16:9 vector – for example, whether you’re holding the camera horizontally or vertically (or in between) – projection of Up vector must be in the plane perpendicular to the look vector (this allows Up vector to be specified at an arbitrary angle to its Look vector ) Up vector Projection of Look vector up vector 1:1 Position 2:1 16:9 Andries van Dam September 20, 2005 3D Viewing II 8/22 Andries van Dam September 20, 2005 3D Viewing II 9/22 I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S View Angle (1/2) View Angle (2/2) • Determines amount of perspective distortion in • Lenses made for distance shots often have a nearly picture, from none (parallel projection) to a lot (wide- parallel viewing angle and cause little perspective angle lens) distortion, though they foreshorten depth • In a frustum, two viewing angles: width and height • Wide-angle lenses cause a lot of perspective angles distortion • Choosing View angle analogous to photographer Resulting picture choosing a specific type of lens (e.g., a wide-angle or telephoto lens) Width angle Height angle Andries van Dam September 20, 2005 3D Viewing II 10/22 Andries van Dam September 20, 2005 3D Viewing II 11/22 3
Recommend
More recommend