viewing the camera and projection gail carmichael ([email protected])
TRANSCRIPT
![Page 2: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/2.jpg)
The Goal
Understand the process of getting from 3D line
segments to images of these lines on the screen.
![Page 3: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/3.jpg)
Canonical View Volume
Windowing transform brings points to pixels: MW
![Page 4: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/4.jpg)
xpixel
ypixel
1
=
xcanonical
ycanonical
1
Canonical View Volume
Mw
![Page 5: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/5.jpg)
Orthographic Projection
Orthographic Perspective
![Page 6: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/6.jpg)
Orthographic Viewing Volume
![Page 7: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/7.jpg)
Orthographic View to Canonical View
x
y
z
1
World to Canonical Coordinates
Scale Move toOrigin
![Page 8: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/8.jpg)
Orthographic View to Canonical View
2/(r-l)
0 0 0
02
/(t-b)0 0
0 02
/(n-f)0
0 0 0 1
x
y
z
1
1 0 0-(l+r)
/2
0 1 0-(b+t)
/2
0 0 1-(n+f)
/2
0 0 0 1
World to Canonical Coordinates
![Page 9: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/9.jpg)
Drawing Lines in Orthographic View
Mo=Mw Mscale Mmove_to_origin
xpixel
ypixel
zcanonical
1
= Mo
x
y
z
1
![Page 10: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/10.jpg)
Arbitrary View Positions
Camera is looking this
wayCamera is centered here
Top of cameragoes this way
![Page 11: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/11.jpg)
Arbitrary View Positions
w = - (g / ||g||)
u = (t × w) / || t × w ||
v = w × u
![Page 12: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/12.jpg)
Arbitrary View Positions
![Page 13: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/13.jpg)
Coordinate Transformations
![Page 14: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/14.jpg)
Coordinate Transformations
![Page 15: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/15.jpg)
Coordinate Transformations
![Page 16: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/16.jpg)
Coordinate Transformations
p = (xp,yp) ≡ o + xpx + ypy
p = (up,vp) ≡ e + upu + vpv
![Page 17: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/17.jpg)
Coordinate Transformationsp = (xp,yp) ≡ o + xpx + ypy
p = (up,vp) ≡ e + upu + vpv
![Page 18: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/18.jpg)
Coordinate Transformations
xp
yp
1
=
up
vp
1
? ?
p = (xp,yp) ≡ o + xpx + ypy
p = (up,vp) ≡ e + upu + vpv
![Page 19: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/19.jpg)
Coordinate Transformations
xp
yp
1
=
1 0 xe
0 1 ye
0 0 1
up
vp
1
xu xv 0
yu yv 0
0 0 1
p = (xp,yp) ≡ o + xpx + ypy
p = (up,vp) ≡ e + upu + vpv
![Page 20: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/20.jpg)
Camera Coordinate Transform
![Page 21: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/21.jpg)
Camera Coordinate Transform
Mv =
1 0 0 -xe
0 1 0 -ye
0 0 1 -ze
0 0 0 1
xu yu zu 0
xv yv zv 0
xw yw zw 0
0 0 0 1
![Page 22: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/22.jpg)
Drawing with Arbitrary View and Orthographic Projection
xpixel
ypixel
zcanonical
1
= Mo Mv
x
y
z
1
![Page 23: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/23.jpg)
Perspective Projection
ys = y(d/z)
![Page 24: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/24.jpg)
Perspective Via Orthographic
![Page 25: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/25.jpg)
Perspective Via Orthographic
![Page 26: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/26.jpg)
Perspective Via Orthographic
![Page 27: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/27.jpg)
Perspective Transform
Mp =
1 0 0 0
0 1 0 0
0 0(n+f)
/n-f
0 01
/n0
![Page 28: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/28.jpg)
Perspective Transform
Mp
x
y
z
1
=
x
y
z[(n+f)/n] - f
z/n
nx/z
ny/z
n + f – (fn/z)
1
![Page 29: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/29.jpg)
Perspective Transform
Mp =
n 0 0 0
0 n 0 0
0 0 (n+f) -fn
0 0 1 0
![Page 30: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/30.jpg)
Drawing with Arbitrary View and Perspective Projection
xpixel
ypixel
zcanonical
1
= Mo Mp Mv
x
y
z
1
![Page 31: Viewing The Camera and Projection Gail Carmichael (gail_c@scs.carleton.ca)](https://reader035.vdocuments.net/reader035/viewer/2022070404/56649f395503460f94c55c36/html5/thumbnails/31.jpg)
CAUTION!!
Everything up until now used the more common right-hand
coordinate system.
Direct3D uses the left-hand coordinate system.
See:http://msdn.microsoft.com/en-us/library/windows/desktop/bb204853%28v=vs.85%29.aspx