3d viewing as a Kodak moment Projection 3D viewing is much like - - PDF document

3d viewing as a kodak moment projection
SMART_READER_LITE
LIVE PREVIEW

3d viewing as a Kodak moment Projection 3D viewing is much like - - PDF document

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


slide-1
SLIDE 1

The CG Camera

Computer Graphics as Virtual Photography

camera (captures light) synthetic image camera model (focuses simulated lighting)

processing

photo processing tone reproduction real scene 3D models Photography: Computer Graphics: Photographic print

3d viewing as a Kodak moment

  • 3D viewing is much like photography

– 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

Projection

  • The role of cameras can be described as

projecting a 3D scene onto a 2D plane

Projection

  • Projection terminology

– Center of projection

  • During the projection, points in the scene will

converge to a given point.

  • This point is the center of projection

– Projection plane

  • 2D plane upon which the 3D scene is getting

projected

Projection

  • Projection types

– Parallel Projection

  • Sometimes called Orthographic Projection
  • Objects of equal size appear the same size after

projected, regardless of the distance they are from the viewing plane.

  • The Center of Projection is at infinity
slide-2
SLIDE 2

Projection

  • Parallel Projection

View plane Object in 3D scene Center of projection at infinity

Projection

  • Projection types

– 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

Projection

  • Perspective Projection

Projection

  • Perspective
  • Parallel

Cameras in Computer Graphics

  • Just like in photography,

– 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

View Volumes

slide-3
SLIDE 3

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

Camera coordinates

  • Defining camera orientation

– Provide the camera location (eyepoint) – Indicate what direction the camera is looking (lookat) – Give the “up” direction of the camera – Then

  • n = eyepoint – lookat
  • u = up x n
  • v = n x u

View Volumes

  • Also needed to define the view volumes

– Location of the near and far clipping planes – This will give you the “range” of the camera

View Volumes

  • Let’s see all this in action!

Projection

  • View coordinate system may not coincide

with world coordinate system.

  • Must transform point in world (x,y,z) to a

point in coordinate system of view (u,v,n)

            =             1 1 z y x M n v u

Projection

            − − − = 1

z z y x y z y x x z y x

  • n

n n

  • v

v v

  • u

u u M

  • (ux,uy,uz) are coordinates
  • f unit u vector w.r.t.

world space

  • Similar for v, n,
  • (ox, oy, oz) is the origin
  • f view space w.r.t world

space

slide-4
SLIDE 4

Projection

  • Now that you’re in u,v,n space, you still

need to perform the perspective projection.

Projection

d p p d p

n u u

+ = ′ d p p d p

n v v

+ = ′ 1 + = ′ d p p p

n u u

1 + = ′ d p p p

n v v

Projection

  • Recall homogeneous coordinates

– (X,Y,Z,W) where x = X/W, y = Y/W, z = Z/W

W p d p p p

u n u u

= + = ′ 1 W p d p p p

v n v v

= + = ′ 1

1 + = d p W

n

Projection

  • In Matrix form:

            =                         =             1 1 1 1 1 1 1 n v u P n v u d W P P P

n v u

Projection

  • Combine with your coordinate system

transform

            =             1

z y x n v u

p p p PM w P P P

Camera Coordinates

  • The coordinates of the objects in the 3D

scene must be converted to the coordinate system of the camera

  • In fact, the whole image generation process

is nothing more than a series of concatenated transformations

slide-5
SLIDE 5

Homogeneous Matrices

{ {

  • bject

camera to world 44 43 42 41 34 33 32 31 24 23 22 21 14 13 12 11 projection 44 43 42 41 34 33 32 31 24 23 22 21 14 13 12 11 plane view

1 1             ⋅             ⋅             =            

  • v

v v

z y x m m m m m m m m m m m m m m m m p p p p p p p p p p p p p p p p z y x 4 4 4 4 3 4 4 4 4 2 1 4 4 4 4 3 4 4 4 4 2 1

Graphics Pipeline Projection

  • And this is how it’s done in computer

graphics

  • Use homogeneous coordinates to include

perspective transformation in matrix transform chain.

  • So how does all this relate to real cameras...

The Pinhole Camera

  • CG uses the pinhole camera model

The Pinhole Camera

  • 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

slide-6
SLIDE 6

Motion blur Realistic Lens models

16mm fisheye 200mm telephoto 50mm double-Gauss 35mm wide-angle

Realistic Camera Models

  • We will talk more about more accurately

modeling “real” camera during our discussion of Tone Reproduction

  • Questions?

Remember

  • Project proposals due in 1 week
  • Class Web Site:

– http://www.cs.rit.edu/~jmg/cgII