Viewing The Camera and Projection Gail Carmichael gailcscs

  • Slides: 31
Download presentation
Viewing The Camera and Projection Gail Carmichael (gail_c@scs. carleton. ca)

Viewing The Camera and Projection Gail Carmichael (gail_c@scs. carleton. ca)

The Goal Understand the process of getting from 3 D line segments to images

The Goal Understand the process of getting from 3 D line segments to images of these lines on the screen.

Canonical View Volume Windowing transform brings points to pixels: MW

Canonical View Volume Windowing transform brings points to pixels: MW

Canonical View Volume xpixel ypixel xcanonical = ycanonical 1 1 Mw

Canonical View Volume xpixel ypixel xcanonical = ycanonical 1 1 Mw

Orthographic Projection Orthographic Perspective

Orthographic Projection Orthographic Perspective

Orthographic Viewing Volume

Orthographic Viewing Volume

Orthographic View to Canonical View x Scale Move to Origin y z 1 World

Orthographic View to Canonical View x Scale Move to Origin y z 1 World to Canonical Coordinates

Orthographic View to Canonical View 2 /(r-l) 0 0 0 1 0 0 -(l+r)

Orthographic View to Canonical View 2 /(r-l) 0 0 0 1 0 0 -(l+r) /2 x 0 2 /(t-b) 0 0 0 1 0 -(b+t) /2 y 0 0 2 /(n-f) 0 0 0 1 -(n+f) /2 z 0 0 0 1 1 World to Canonical Coordinates

Drawing Lines in Orthographic View Mo=Mw Mscale Mmove_to_origin xpixel x ypixel y zcanonical 1

Drawing Lines in Orthographic View Mo=Mw Mscale Mmove_to_origin xpixel x ypixel y zcanonical 1 = Mo z 1

Arbitrary View Positions Top of camera goes this way Camera is centered here Camera

Arbitrary View Positions Top of camera goes this way Camera is centered here Camera is looking this way

Arbitrary View Positions w = - (g / ||g||) u = (t × w)

Arbitrary View Positions w = - (g / ||g||) u = (t × w) / || t × w || v= w×u

Arbitrary View Positions

Arbitrary View Positions

Coordinate Transformations

Coordinate Transformations

Coordinate Transformations

Coordinate Transformations

Coordinate Transformations

Coordinate Transformations

Coordinate Transformations p = (xp, yp) ≡ o + xpx + ypy p =

Coordinate Transformations p = (xp, yp) ≡ o + xpx + ypy p = (up, vp) ≡ e + upu + vpv

Coordinate Transformations p = (xp, yp) ≡ o + xpx + ypy p =

Coordinate Transformations p = (xp, yp) ≡ o + xpx + ypy p = (up, vp) ≡ e + upu + vpv

Coordinate Transformations p = (xp, yp) ≡ o + xpx + ypy p =

Coordinate Transformations p = (xp, yp) ≡ o + xpx + ypy p = (up, vp) ≡ e + upu + vpv xp yp 1 up = ? ? vp 1

Coordinate Transformations p = (xp, yp) ≡ o + xpx + ypy p =

Coordinate Transformations p = (xp, yp) ≡ o + xpx + ypy p = (up, vp) ≡ e + upu + vpv xp yp 1 = 1 0 xe xu xv 0 up 0 1 ye yu yv 0 vp 0 0 1 1

Camera Coordinate Transform

Camera Coordinate Transform

Camera Coordinate Transform Mv = xu yu zu 0 1 0 0 -xe xv

Camera Coordinate Transform Mv = xu yu zu 0 1 0 0 -xe xv yv zv 0 0 1 0 -ye xw yw zw 0 0 0 1 -ze 0 0 0 1

Drawing with Arbitrary View and Orthographic Projection xpixel x ypixel y zcanonical 1 =

Drawing with Arbitrary View and Orthographic Projection xpixel x ypixel y zcanonical 1 = M o Mv z 1

Perspective Projection ys = y(d/z)

Perspective Projection ys = y(d/z)

Perspective Via Orthographic

Perspective Via Orthographic

Perspective Via Orthographic

Perspective Via Orthographic

Perspective Via Orthographic

Perspective Via Orthographic

Perspective Transform Mp = 1 0 0 0 (n+f) /n 1 /n -f 0

Perspective Transform Mp = 1 0 0 0 (n+f) /n 1 /n -f 0

Perspective Transform Mp x x nx/z y y ny/z z[(n+f)/n] - f n +

Perspective Transform Mp x x nx/z y y ny/z z[(n+f)/n] - f n + f – (fn/z) z/n 1 z 1 =

Perspective Transform Mp = n 0 0 0 0 (n+f) -fn 0 0 1

Perspective Transform Mp = n 0 0 0 0 (n+f) -fn 0 0 1 0

Drawing with Arbitrary View and Perspective Projection xpixel x ypixel y zcanonical 1 =

Drawing with Arbitrary View and Perspective Projection xpixel x ypixel y zcanonical 1 = M o Mp Mv z 1

CAUTION!! Everything up until now used the more common right-hand coordinate system. Direct 3

CAUTION!! Everything up until now used the more common right-hand coordinate system. Direct 3 D uses the left-hand coordinate system. See: http: //msdn. microsoft. com/enus/library/windows/desktop/bb 204853%28 v=vs. 85%29. aspx