Title: Projection
1Projection
2Definitions
- Projection a transformation that maps from a
higher dimensional space to a lower dimensional
space (e.g. 3D-gt2D) - Center of projection (CoP) the position of the
eye or camera with respect to which the
projection is performed (also eyepoint, camera
point, proj. reference point) - Projection plane in a 3D-gt2D projection, the
plane to which the projection is performed (also
viewplane)
3Planar Projections
Perspective Distance to CoP is finite
Parallel Distance to CoP is infinite
4Projections
5Parallel Projections (1/2)
- Orthographic Direction of projection is
orthogonal to the projection plane - Elevations Projection plane is perpendicular to
a principal axis - Front
- Top (Plan)
- Side
- Axonometric Projection plane is not orthogonal
to a principal axis - Isometric Direction of projection makes equal
angles with each principal axis.
6Parallel Projections (2/2)
- Oblique Direction of projection is not
orthogonal to the projection plane projection
plane is normal to a principal axis - Cavalier Direction of projection makes a 45
angle with the projection plane - Cabinet Direction of projection makes a 63.4
angle with the projection plane
7Perspective Projections
- One-point
- One principal axis cut by projection plane
- One axis vanishing point
- Two-point
- Two principal axes cut by projection plane
- Two axis vanishing points
- Three-point
- Three principal axes cut by projection plane
- Three axis vanishing points
8Perspective Projections
9One-Point Projection
(x, y, z)
- Center of Projection on the negative z-axis with
viewplane in the x-y plane. - xprojected xd/(dz) x/(1(z/d))
- yprojected yd/(dz) y/(1(z/d))
Z
(xproj, yproj, 0)
(0, 0, -d)
-Z
10Another one-Point Projection
- Center of Projection at the origin with viewplane
parallel to the x-y plane a distance d from the
origin. - xprojected dx/z x/(z/d)
- yprojected dy/z y/(z/d)
Z
-Z
Mper Points plotted are x/w, y/w where w z/d
11Specifying An Arbitrary 3-D View
- Two coordinate systems
- World reference coordinate system (WRC)
- Viewing reference coordinate system (VRC)
- First specify a viewplane and coordinate system
(WRC) - View Reference Point (VRP)
- View Plane Normal (VPN)
- View Up Vector (VUP)
- Specify a window on the view plane (VRC)
- Max and min u,v values (Center of the window
(CW)) - Projection Reference Point (PRP)
- Front (F) and back (B) clipping planes (hither
and yon)
12Specifying A View
v
VUP
(umax, vmax)
VRP
CW
(umin, vmin)
u
VPN
n
PRP
13Normalizing (Viewing) Transformation
- Translate VRP to origin
- Rotate the VRC system such that the VPN (n-axis)
becomes the z-axis, the u-axis becomes the x-axis
and the v-axis becomes the y-axis - Translate so that the CoP given by the PRP is at
the origin - Shear such that the center line of the view
volume becomes the z-axis - Scale so that the view volume becomes the
canonical view volume, bounded by six planes y
z, y -z, xz, x -z, z zmin, z zmax
141. Translate VRP to origin
152. Rotate VRC (1/2)
- We want to transform
- u into (1, 0, 0)
- v into (0, 1, 0)
- n into (0, 0, 1)
- First derive n, u, and v from user input
- n VPN / VPN
- u (Vup x n) / Vup x n
- v n x u
- u, v, and n are unit (normalized) vectors
162. Rotate VRC (2/2)
- Special orthogonal matrix
173.Translate so that the PRP is at the origin
Note The PRP is given in View Reference
Coordinates. The originof the VRC (the VRP) is
currently at the origin of world coordinates,so
this translation will move the PRP to the world
origin.
184. Shear such that the center line of the view
volume becomes the z-axis
Center line of window lies along the vector CW,
-PRP, this is thedirection of projection, DoP
194. Shear (cont.)
- The shear matrix must take this direction of
projection and shear it to the z-axis , DoP'
0, 0, DoPz.
204. Shear (cont.)
- We want to find a shear matrix SHper such that
- SHDoP DoP0, 0, DoPz
- SHx -DoPx/DoPz, SHy -DoPy/DoPz
-
215. Scale (1/3)
y v - v
max
min
current view volume
2
z -PRPn B
z-PRPn F
z-PRPn
y -v v
max
min
2
225. Scale (2/3)
desired view volume
235. Scale (3/3)
- Scale is done in two steps
- 1. First scale in x and y so sides of view
volume form 45 angles - sx 2PRPn/(umax - umin)
- sy 2PRPn/(vmax - vmin)
- 2. Scale everything uniformly such that the back
clipping plane becomes z -1 - sx -1 / (-PRPn B)
- sy -1 / (-PRPn B)
- sz -1 / (-PRPn B)
24Total Composite Transformation
- Nper Sper SHper T(-PRP) R T(-VRP)
253D Rendering Sequence of events
- 1. Define object in world coordinates
- 2. Define viewing parameters
- 3. Apply normalizing transformation to object
- 4. Clip object in the canonical view volume
- 5. Project object to the viewplane
- 6. Window-viewport transformation
- 7. Rasterize object
263D Viewing example
- Object triangle w/ vertices (0,0,0), (1,0,0),
(0,0,1) - VRP (2,1,2)
- VPN (1,0,1)
- VUP (0,1,0)
- PRP (view coords.) (0,0,2)
- window from (-2,-1) to (2,1) (u,v coords.)
- Back clipping plane at n-4
- viewport 200x100 pixels
273D Viewing example
Y
VRP
X
PRP
Z
28Step 1 Translate VRP to origin
- T (-2,-1,-2)
- (0,0,0) becomes (-2,-1,-2)
- (1,0,0) becomes (-1,-1,-2)
- (0,0,1) becomes (-2,-1,-1)
29Step 2 Rotate VRC into WRC
- Rotate by -45 deg. about y-axis
- (-2,-1,-2) becomes (0,-1, -2v2)
- (-1,-1,-2) becomes (v2/2,-1,-3v2/2)
- (-2,-1,-1) becomes (-v2/2,-1,-3v2/2)
30Step 3 Translate PRP to origin
- T(0,0,-2)
- (0,-1,-2v2) becomes (0,-1,-2v2-2)
- (v2/2,-1,-3v2/2) becomes
- (v2/2,-1,-3v2/2-2)
- (-v2/2,-1,-3v2/2) becomes
- (-v2/2,-1,-3v2/2-2)
31Step 4 Shear
- Not necessary because center line of view volume
already lies on the z-axis
32Step 5a Scale to canonical view volume
- Scale by 4/4 in x, 4/2 in y
- (0,-1,-2v2-2) becomes (0,-2,-2v2-2)
- (v2/2,-1,-3v2/2-2) becomes
- (v2/2,-2,-3v2/2-2)
- (-v2/2,-1,-3v2/2-2) becomes
- (-v2/2,-2,-3v2/2-2)
33Step 5b Scale to canonical view volume
- Scale by -1/(-2-4)1/6 in all dimensions
- (0,-2,-2v2-2) becomes (0,-1/3,-v2/3-1/3)
- (v2/2,-2,-3v2/2-2) becomes
- (v2/12,-1/3,-v2/4-1/3)
- (-v2/2,-2,-3v2/2-2) becomes
- (-v2/12,-1/3,-v2/4-1/3)
34Projecting the points
- (x,y,z) projects to (x/(z/d), y/(z/d)) where d
-1/3 - (0,-1/3,-v2/3-1/3) to (0,-1/3(v21))
- (v2/12,-1/3,-v2/4-1/3) to (v2/(9v212),
-4/(9v212)) - (-v2/12,-1/3,-v2/4-1/3) to
- (-v2/(9v212), -4/(9v212))
35Window-viewport transform
- translate by (1/3,1/3), scale by (300,150)
- (0,-1/3(v21)) becomes (100, -50/(v21)50)
- (v2/(9v212), -4/(9v212)) becomes
- (300v2/(9v212)100, -600/(9v212)50)
- (-v2/(9v212), -4/(9v212)) becomes
- (-300v2/(9v212)100, -600/(9v212)50)
36Final rendered image
100
50
(100,29.29)
25
(82.84,25.74)
(117.16,25.74)
0
200
100