intro to camera models
play

Intro to Camera Models Photography: scene (captures processing - PDF document

Computer Graphics as Virtual Photography real camera photo Photographic Intro to Camera Models Photography: scene (captures processing print light) processing camera Computer 3D tone synthetic model Graphics: models image


  1. Computer Graphics as Virtual Photography real camera photo Photographic Intro to Camera Models Photography: scene (captures processing print light) processing camera Computer 3D tone synthetic model Graphics: models image reproduction (focuses simulated lighting) 3d viewing as a Kodak moment Projection  3D viewing is much like photography  The role of cameras can be described as projecting a 3D scene onto a 2D plane  Set up a scene  Grab a camera  Take a snapshot  Final print is a 2D representation  Of the 3D scene  Taken from a given perspective Graphics Pipeline Projection  Projection terminology 3D Object 3D World 3D Eye 3D Eye 2D Eye 2D Screen  Center of projection Coordinates Coordinates Coordinates Coordinates Coordinates Coordinates  During the projection, points in the scene will Object Viewing 3D Clipping Projection Window to Viewport converge to a given point. Transformation Transformation Mapping  This point is the center of projection  Projection plane  2D plane upon which the 3D scene is getting projected 1

  2. Projection Projection  Projection types  Parallel Projection  Parallel Projection  Sometimes called Orthographic Projection Center of  Objects of equal size appear the same size projection after projected, regardless of the distance they at infinity are from the viewing plane. Object in  The Center of Projection is at infinity View plane 3D scene Projection Projection  Projection types  Perspective Projection  Perspective Projection  Sometimes called Frustrum Projection  Objects closer to the view plane will appear larger when projected than objects of the same size that are farther from the view point.  The Center of Projection is at camera location (eyepoint)  This is the projection used by “real” cameras Cameras in Computer Projection Graphics  Just like in photography,  Perspective  Parallel  Your camera will define what part of the scene you can see.  Based on:  Projection type used by camera  Location of camera  Direction of camera  Orientation of camera  “Range” of your camera  All of the above will define a view volume  All objects in the view volume are seen by the camera 2

  3. View Volumes Camera Coordinates  Camera Orientation  The camera has it’s own 3D coordinate system based on it’s orientation  u,v,n  u corresponds to x (as seen by the camera)  v corresponds to y (as seen by the camera)  n corresponds to z (as seen by the camera)  Negative n is into the scene Graphics Pipeline Camera coordinates  Defining camera orientation  Provide the camera location (eyepoint) 3D Object 3D World 3D Eye 3D Eye 2D Eye 2D Screen Coordinates Coordinates Coordinates Coordinates Coordinates Coordinates  Indicate what direction the camera is looking (lookat) Object Viewing 3D Clipping Projection Window to Viewport  Give the “up” direction of the camera Transformation Transformation Mapping  Then  n = eyepoint – lookat  u = up x n  v = n x u  Note: right handed coordinate system View Volumes View Volumes  Also needed to define the view volumes  Let’s see all this in action!  Location of the near and far clipping planes  (SIGGRAPH projection tutorial)  This will give you the “range” of the camera 3

  4. Camera Coordinates Camera Coordinates  View coordinate system may not coincide  (u x ,u y ,u z ) are  u u u -eye• u  coordinates of unit u with world coordinate system. x y z   vector w.r.t. world space v v v -eye• v  Must transform point in world (x,y,z) to a  x y z  =  Similar for v, n, M -eye• n point in coordinate system of view (u,v,n)   n n n  ( eye ) is the origin of x y z   u x 0 0 0 1 view space w.r.t world � � � �   space � � � � v y  If ups are aligned, simply � � � � M = use negative eye location n z � � � � values in the fourth � � � � column 1 1 � � � � Projection Graphics Pipeline  Now that you’re in u,v,n space, you still need to perform the perspective projection. 3D Object 3D World 3D Eye 3D Eye 2D Eye 2D Screen Coordinates Coordinates Coordinates Coordinates Coordinates Coordinates Object Viewing 3D Clipping Projection Window to Viewport Transformation Transformation Mapping Projection Projection p p �  Recall homogeneous coordinates u u = d p d + n  (X,Y,Z,W) where x = X/W, y = Y/W, z = p Z/W p u � = u p n 1 + d p p p p p u u p v v � = = � = = p � p u p v p W W 1 1 v v n n = + + d d d p d + n p p p v � W = d n 1 = + v p 1 n + d 4

  5. Projection Projection  In Matrix form:  Combine with your coordinate system transform P 1 0 0 0 u u � � � � � � � � u P p � � � � � � � � � � � � u x P 0 1 0 0 v v v � � � � � � � � � � P � � = = P p P 0 0 1 0 n n � � � � � � � � v y � � PM � � = n � � � � � � � � P p � � � � W 0 0 1 d 1 1 1 � � � � � � � � n z � � � � w 1 � � � � Camera Coordinates Homogeneous Matrices  The whole image generation process is nothing more than a series of p p p p m m m m x x � � � � � � � � v 11 12 13 14 11 12 13 14 w concatenated transformations � � � � � � � � y p p p p m m m m y � v � � 21 22 23 24 � � 21 22 23 24 � � w � = � �  Note that explicit projection is z p p p p m m m m z � � � � � � � � v 31 32 33 34 31 32 33 34 w � � � � unnecessary in ray tracing as it is done � � � 1 � p p p p m m m m w � � � � � � � � 41 42 43 44 41 42 43 44 { 1 4 4 4 4 2 4 4 4 4 3 1 4 4 4 4 2 4 4 4 4 3 { as part of the ray tracing process. view plane world projection world to camera Graphics Pipeline Projection  And this is how it’s done in computer graphics 3D Object 3D World 3D Eye 3D Eye 2D Eye 2D Screen Coordinates Coordinates Coordinates Coordinates Coordinates Coordinates  Use homogeneous coordinates to Object Viewing 3D Clipping Projection Window to Viewport include perspective transformation in Transformation Transformation Mapping matrix transform chain.  So how does all this relate to real cameras... 5

  6. The Pinhole Camera The Pinhole Camera  CG uses the pinhole camera model  However  Real cameras have real openings (apertures) -- depth of field  Shutter speed is not instantaneous -- motion blur  Projection is not necessarily perfectly perspective – lens warping Depth of field Motion blur Realistic Lens models Realistic Camera Models  We will talk more about more accurately modeling “real” cameras later in the quarter. 35mm wide-angle 200mm telephoto  Questions? 50mm double-Gauss 16mm fisheye 6

  7. Questions? 7

Recommend


More recommend