Common Coordinate Viewing in 3D Systems (Chapt. 6 in FVD, Chapt. 12 in Hearn & Baker) • Object space – local to each object • World space – common to all objects • Eye space / Camera space – derived from view frustum • Screen space – indexed according to hardware attributes Specifying the Viewing y v Coordinates Up P u w • Viewing Coordinates system , [u, P 0 v, w], describes 3D objects with x z respect to a viewer. View plane • A viewing plane ( projection plane ) is set up perpendicular to • P 0 =(x 0 ,y 0 ,z 0 ) is a point where a w and aligned with (u,v). camera is located. • To set a view plane we have to • P is a point to look-at. specify a view-plane normal • N=(P 0 -P)/|P 0 -P| is the view-plane vector, N, and a view-up vector, normal vector. Up, (both, in world coordinates): • Up is the view up vector, whose projection onto the view-plane is directed up. • How to form Viewing How to form Viewing coordinate system coordinate system : Up N Up N � w ; u ; v w u � � � � N N Up N � • The transformation, M, from world-coordinate into viewing- coordinates is: 0 1 0 0 x u u u � � � � � 0 x y z / || || w � N N � � � � 0 1 0 v v v 0 y � 0 � x y z � � � M � 0 0 1 � w w w 0 � z � � � x y z 0 � � � � First, normalize the look-at vector to form the w-axis 0 0 0 1 0 0 0 1 � � � � � �
Create V perpendicular to U and W Create U perpendicular to Up and W V Up Up W W U U Up W � V W U � � U � | | Up W � Projections • Viewing 3D objects on a 2D display requires a mapping from 3D to 2D. • A projection is formed by the intersection of certain lines ( projectors ) with the view plane. • Projectors are lines from the center of projection through each point in the object. Center of Projection • Center of projection at infinity Parallel Projection results with a parallel projection. • A finite center of projection results A parallel projection preserves relative with a perspective projection. proportions of objects, but does not give realistic appearance (commonly used in engineering drawing).
Parallel Projection Perspective Projection • Projectors are all parallel. A perspective projection produces realistic • Orthographic: Projectors are appearance, but does not preserve relative proportions. perpendicular to the projection plane. • Oblique: Projectors are not necessarily perpendicular to the projection plane. Orthographic Oblique • Lengths and angles of faces Orthographic Projection parallel to the viewing planes are preserved. • Since the viewing plane is aligned with (x v ,y v ), orthographic • Problem : 3D nature of projected projection is performed by: objects is difficult to deduce. 1 0 0 0 x x x � � � � � � � � p v v Top View � � � � � � � � y y 0 1 0 0 y p v v � � � � � � � � � � 0 0 0 0 0 0 z � � � � � � � � v � � � � � � � � 1 1 0 0 0 1 1 � � � � � � � � Side View Front view (x,y,z) (x,y) y v x v P 0 z v • Cavalinear projection : Oblique Projection – Preserves lengths of lines perpendicular to the viewing plane. • Projectors are not perpendicular to the viewing plane. – 3D nature can be captured but • Angles and lengths are preserved for faces shape seems distorted. parallel to the plane of projection. • Cabinet projection: • Somewhat preserves 3D nature of an object. – lines perpendicular to the viewing plane project at 1/2 of their length. – A more realistic view than the Cavalinear projection. y 1 1 1/2 1 x x 1 1 45 ° 45 ° z z Cavalinear Projection Cabinet Projection
Perspective Projection • In a perspective projection, the center of projection is at a finite distance from the viewing plane. • Parallel lines that are not parallel to the viewing plane, converge to a vanishing poin t. – A vanishing point is the projection of a point at infinity. Z-axis vanishing point y x z y Vanishing Points • There are infinitely many general vanishing points. x • There can be up to three axis vanishing points (principal z vanishing points). • Perspective projections are One point (z axis) categorized by the number of perspective projection principal vanishing points, equal to the number of principal axes x axis z axis intersected by the viewing plane. vanishing point. vanishing point. • Most commonly used: one-point and two-points perspective. Two points perspective projection
3-point Perspective M.C.Escher’ s " Relativity " where 3 worlds co- exist thanks to 3-point perspective. 3-point Perspective Perspective Projection A perspective projection produces (x,y,z) realistic appearance, but does not (x p ,y p ,0) preserve relative proportions. y d x center of projection z x (x,y,z) x p z d • Using similar triangles it follows: x y x y p p ; � � d z d d z d � � d x d y � � x ; y ; z 0 � � � p p p z d z d � �
• Thus, a perspective projection Observations matrix is defined: • M per is singular (|M per |=0), thus 1 0 0 0 M per is a many to one mapping � � � � 0 1 0 0 � � M per � 0 0 0 0 � � • Points on the viewing plane 1 � � 0 0 1 � � (z=0) do not change. d � � • The vanishing point of parallel 1 0 0 0 x � � x � � � � lines directed to (U x ,U y ,U z ) is at � � � � 0 1 0 0 � � y y � � � � [dU x /U z , dU y /U z ]. � � M per P � � 0 0 0 0 0 � � � � z � � 1 z d � � � � � � � • When d � , M per M ort 0 0 1 1 � � � � d � � d � � � � d x d y � � x ; y ; z 0 � � � p p p z d z d � � Zoom-in Zoom-in Projection Projection plane plane Center of Center of Projection Projection What is the difference between moving the center of Summary projection and moving the projection plane? Original Planar geometric projections z Center of Projection plane Projection Parallel Perspective Moving the Center of Projection One Oblique Orthographic point Front Top Two Cavalinear point Other Side z Center of Projection Cabinet Projection plane Other Three Moving the Projection Plane point z Projection Center of Projection plane
Another view in Another view in Perspective Perspective 7KUHH�SRLQW�SHUVSHFWLYH 7ZR�SRLQW�SHUVSHFWLYH )RXU�SRLQW�SHUVSHFWLYH 7KUHH�SRLQW�SHUVSHFWLYH Fisheye views of the Hagia Sophia )LYH�SRLQW�SHUVSHFWLYH�" (Istanbul) (also known as Aya Sofya ) 6L[�SRLQW�SHUVSHFWLYH�"
Vertical lines Fisheye view View Window House of Stairs • After objects were projected onto the viewing plane, an image is taken from a View Window . • A view window can be placed anywhere on the view plane. • In general the view window is aligned with the viewing coordinates and is defined by its extreme points: (xw min ,yw min ) and (xw max ,yw max ) e a n l w p e V i y v (xw max ,yw max ) x v View window z v (xw min ,yw min ) M.C. Escher’ s House of Stairs View Volume • In order to limit the infinite view volume we define two additional planes: Near Plane and • Given the specification of the view Far Plane . window, we can set up a View Volume . • Only objects in the bounded view volume can appear. • Only objects inside the view volume might appear in the display, the rest are • The near and far planes are parallel to the view plane and specified by z near and z far . clipped. • A limited view volume is defined: – For orthographic: a rectangular parallelpiped. – For oblique: an oblique parallelpiped. – For perspective: a frustum. Far z v Plane Near Plane w o d z v i n w w Far o d i n w Near Plane Plane
Recommend
More recommend