Viewing Transformations CS5600 Computer Graphics by Rich Riesenfeld 5 March 2002 Lecture Set 11
Homogeneous Coordinates An infinite number of points correspond to (x,y,1). They constitute the whole line (tx,ty,t). w = 1 (tx,ty,t) (x,y,1)
CS56003 Illustration: Old Style, Simple Transformation Sequence for 3D Viewing
CS56004 Simple Viewing Transformation Example PointsABCDEFGH X11 11 Y11 11 Z 1111
Simple Cube Viewed from (6,8,7.5) A=(-1,1,-1) B=(1,1,-1) C=(1,-1,-1) D=(-1,-1,-1) G=(1,-1,1) E=(-1,1,1) H=(-1,-1,1) F=(1,1,1)
CS56006 Topology of Cube ABCDEFGH A B C D E F G H BC E H D F G A
CS56007 Topology of Cube A:BDE B:ACF C:BDG D:ACH E:AFH F:BEG G:CFH H:DEG BC E H D F G A
CS56008 Simple Example Give a Cube with corners View from Eye Position (6,8,7.5) Look at Origin (0,0,0) “Up” is in z-direction
CS56009 Translate Origin by (6,8,0)
CS Simple Viewing Transformation Example
CS Build LH Coord with (6,8,0)
CS Build LH Coord with
CS Rotate about y with (6,8,0)
CS Simple Viewing Transformation Example
CS Rotate about x-axis with
CS Look at the (3-4-5) Right Triangle (4) (5) (3)
CS Simple Viewing Transformation Examle
CS View on 10x10 screen, 20 away 10 20
CS Map to canonical frustum 20
CS Scale x,y by 2 for normalization Will view a 20”x20” screen from 20” away. Scale to standard viewing frustum.
CS Simple Viewing Transformation Example
CS Clipping not needed, so project
CS Transformation of Cube
CS Cube Transformed for Viewing PtsABCDEFGH X Y Z
G=(-2.8,1.84) 25 PtXY A B C D0.408 E F G H A:BDE B:ACF C:BDG D:ACH E:AFH F:BEG G:CFH H:DEG Transformed Cube B=(-0.4,-3.28) C=(-2.8,-1.36) D=(0.4,.08) E=(2.8,1.36) A=(2.8,-1.84) H=(0.4,3.28) F=(-0.4,-.08)
CS Recall mapping [a,b] [-1,1] Translate center of interval to origin Normalize interval to [-1,1]
CS Substitute x =a: x Recall mapping [a,b] [-1,1]
CS Substitute x =b: x Recall mapping [a,b] [-1,1]
CS Map to the (1K x 1K) screen Assume screen origin (0,0) at lower left. This translates old (0,0) to center of screen (511,511).
CS Map to the (1K x 1K) screen Proper scale factor for mapping: [-1,1] to (-511,+511)
CS Combine Screen Transformation
CS For General Screen: ……
CS Transformation to Std Clipping Frustum
CS Transforming to Std Frustum
CS Transforming to Std Frustum
CS Transforming to Std Frustum The right scale matrix to map to canonical form
CS Transforming to Std Frustum
Determining Rotation Matrix
CS Frame rotation,
CS Inverse problem easy,
CS In matrix representation of, Columns are simply images of
CS Rotation matrix M columns given by frame’s pre-image Column i of is
CS Inverse of rotation matrix M Recall, for rotation matrix R, So,
CS Rotation matrix M Row i is simply Simply write M down! Thus,
CS Frame Rotation:
46
47
48
49
50
51
52
The End of Viewing Transformations Lecture Set 11 53