230 likes | 572 Views
3D Projection Transformations. Soon Tee Teoh CS 147. 3D Projections. Rays converge on eye position. Rays parallel to view plane. Perspective. Parallel. Orthographic. Oblique. Cabinet. Cavalier. Elevations. Axonometric. Isometric. Perspective and Parallel Projections. View plane.
E N D
3D Projection Transformations Soon Tee Teoh CS 147
3D Projections Rays converge on eye position Rays parallel to view plane Perspective Parallel Orthographic Oblique Cabinet Cavalier Elevations Axonometric Isometric
Perspective and Parallel Projections View plane Perspective Parallel
3D Projections Rays converge on eye position Rays parallel Perspective Parallel Rays at angle to view plane Rays perpendicular to view plane Orthographic Oblique Cabinet Cavalier Elevations Axonometric Isometric
Parallel Projections:Orthographic and Oblique View plane Oblique Orthographic
Principal Axes • Man-made objects often have “cube-like” shape. These objects have 3 principal axes. From www.loc.gov/ jefftour/cutaway.html
One point, two point, three point perspective • Depends on how many principal axes intersect with view plane. • Parallel lines not parallel to view plane have the same vanishing point. One point perspective: One principal axis intersects view plane
One point, two point, three point perspective Two point perspective: two principal axes intersect view plane
One point, two point, three point perspective Three point perspective: Three principal axes intersect view plane
One point, two point, three point perspective View Plane Three point Two point One point
3D Projections Rays converge on eye position Rays parallel Perspective Parallel Rays at angle to view plane Rays perpendicular to view plane Orthographic Oblique View plane aligned with principal axes View plane not aligned with principal axes Cabinet Cavalier Elevations Axonometric Isometric Trimetric Dimetric
Front Elevation • Parallel Orthogonal Elevation Front elevation of tallest buildings in the world From members.iinet.net.au/ ~paulkoh
Isometric View • In isometric view, the three principal axes of the object intersect the view plane at equal distance. Therefore, when projected, they are 120o apart. http://sucod.shef.ac.uk/sucod/gallery/arc320/2003/p2/Rachel/images/colour.JPG
3D Projections Rays converge on eye position Rays parallel Perspective Parallel Rays at angle to view plane Rays perpendicular to view plane Orthographic Oblique Cabinet Cavalier Elevations Axonometric Isometric
Oblique projections • Projection lines are at an angle to the view plane. • Let the angle be a be the angle the projection line makes with the view plane. • tan a = 1 (or, a = 45o) called cavalier projection • tan a = 2 (or, a = 63.4o) called cabinet projection 1 2 a a 1 1 cavalier cabinet 1 1/2 1 1
Orthographic Parallel Projection Matrix • Transform each vertex from Viewing Coordinates into Normalized Coordinates using orthographic projection • Suppose that a point is (x,y,z) in Viewing Coordinates, what’s the transformation necessary to transform it to (x’,y’,z’) in Normalized Coordinates? • Given: the dimensions of the view window: xwmin, xwmax, ywmin, ywmax • Orthogonal Projection Matrix on p. 362. • Basically Translate center of view to origin and then Scale to (-1,1) cube • Translate by -(min+max)/2, then scale by 2/(max-min). xwmax+ xwmin xwmax - xwmin 2 xwmax - xwmin 0 0 - 2 ywmax - ywmin ywmax+ ywmin ywmax - ywmin 0 - 0 M = -2 znear - zfar znear + zfar znear - zfar 0 0 0 0 0 1
Perspective Projection Matrix • Suppose camera position is at origin (0,0,0) • Suppose view plane is at distance d from origin • Consider top view Original point in viewing coordinates View plane x Point projected to view plane x x’ (0,0,0) z d z The projected coordinate, x’ = dx/z Similarly, y’ = dy/z
Perspective Projection Matrix 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1/d 0 Perspective Projection Matrix M = In homogeneous coordinates, 1 0 0 0 x x 0 1 0 0 y y 0 0 1 0 z z 0 0 1/d 0 1 z/d = Point in viewing coordinates Point projected to view plane In normal coordinates, (x’,y’,z’) = (dx/z,dy/z,d)