Viewing TransformationsHomogeneous CoordinatesIllustration: Old Style, Simple Transformation Sequence for 3D ViewingSimple Viewing Transformation ExampleSimple Cube Viewed from (6,8,7.5)Topology of CubeSlide 7Simple ExampleSlide 9Slide 10Slide 11Slide 12Slide 13Slide 14Rotate about x-axis withLook at the (3-4-5) Right TriangleSimple Viewing Transformation ExamleView on 10x10 screen, 20 awayMap to canonical frustumScale x,y by 2 for normalizationSlide 21Clipping not needed, so projectTransformation of CubeCube Transformed for ViewingSlide 25Recall mapping [a,b] [-1,1]Slide 28Map to the (1K x 1K) screenSlide 30Combine Screen TransformationFor General Screen: ……Transformation to Std Clipping FrustumTransforming to Std FrustumSlide 35Slide 36Slide 37Determining Rotation MatrixFrame rotation,Inverse problem easy,In matrix representation of ,Rotation matrix MInverse of rotation matrix MSlide 44Frame Rotation:Slide 46Slide 47Slide 48Slide 49Slide 50Slide 51Slide 52The End of Viewing TransformationsViewing TransformationsCS5600 Computer GraphicsbyRich Riesenfeld5 March 2002Lecture Set 11Homogeneous CoordinatesAn infinite number of points correspond to (x,y,1). They constitute the whole line (tx,ty,t).xwyw = 1(tx,ty,t)(x,y,1)CS5600 3Illustration: Old Style, Simple Transformation Sequence for 3D ViewingCS5600 4Simple Viewing Transformation ExamplePoints A B C D E F G HX -1 1 1 -1 -1 1 1 -1Y 1 1 -1 -1 1 1 -1 -1Z -1 -1 -1 -1 1 1 1 1Simple Cube Viewed from (6,8,7.5)xzyA=(-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)CS5600 6Topology of CubeA B C D E F G HA 0 1 0 1 1 0 0 0B 1 0 1 0 0 1 0 0C 0 1 0 1 0 0 1 0D 1 0 1 0 0 0 0 1E 1 0 0 0 0 1 0 1F 0 1 0 0 1 0 1 0G 0 0 1 0 0 1 0 1H 0 0 0 1 1 0 1 0BCEHDFGACS5600 7Topology of CubeA: B D EB: A C FC: B D GD: A C HE: A F HF: B E GG: C F HH: D E GBCEHDFGACS5600 8Simple 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 )1,1,1( CS5600 9xzyxˆzˆyˆTranslate Origin by T1(6,8,0)xˆzˆyˆCS5600 10Simple Viewing Transformation Example10005.7100801060011TCS5600 11xzyexˆezˆeyˆBuild LH Coord with T2(6,8,0)xˆzˆyˆCS5600 1210000010010000012TBuild LH Coord with T2CS5600 13xzyexezeyRotate about y withT3(6,8,0)6810xˆzˆyˆCS5600 14100008.06.001006.08.3TSimple Viewing Transformation Example106)sin(108)cos(,whereCS5600 15Rotate about x-axis with xzyexezey7.5T410xˆyˆzˆCS5600 16Look at the (3-4-5) Right Triangle7.51012.553)sin(54)cos((4)(5)(3)CS5600 17Simple Viewing Transformation Examle100008.6.006.8.000014T53)sin(54)cos(,whereCS5600 18View on 10x10 screen, 20 away10102030CS5600 19Map to canonical frustum452020CS5600 201000010000200002NScale x,y by 2 for normalizationWill view a 20”x20” screen from 20” away. Scale to standard viewing frustum.CS5600 2110005.126.64.48.06.196.72.002.16.11234TTTTNSimple Viewing Transformation ExampleCS5600 22Clipping not needed, so project 1000000000100001icorthographPCS5600 231111111111111111111111111111111110005.126.64.48.06.196.72002.16.1.Transformation of Cube1111111113.0212.0610.7811.7414.2213.2611.9812.943.281.840.08-1.36.0801.36-3.28-1.84-0.42.8-0.4-2.80.42.8-0.4-2.8CS5600 24Cube Transformed for ViewingPts A B C D E F G HX2.8 -0.4 -2.8 0.4 2.8 -0.4 -2.8 0.4Y-1.84 -3.28 -1.36 .08 1.36 -.08 1.84 3.28Z12.94 11.98 13.26 14.22 11.74 10.78 12.06 13.02G=(-2.8,1.84)25Pt X YA 2.8 -1.84B -0.4 -3.28C -2.8 -1.36D 0.4 08E 2.8 1.36F -0.4 -.08G -2.8 1.84H 0.4 3.28A: B D EB: A C FC: B D GD: A C HE: A F HF: B E GG: C F HH: D E GTransformed CubeB=(-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)CS5600 26Recall mapping [a,b] [-1,1]•Translate center of interval to origin•Normalize interval to [-1,1]2baxx2221baxbaxabCS5600 27•Substitute x =a:12)(22222222ababbaaabbaaabx Recall mapping [a,b] [-1,1]CS5600 28•Substitute x =b:1222222222ababbababbababx Recall mapping [a,b] [-1,1]CS5600 29Map to the (1K x 1K) screen 10000100511010511001TAssume screen origin (0,0) at lower left. This translates old (0,0) to center of screen (511,511).CS5600 30Map to the (1K x 1K) screen 10000100005110000511xySProper scale factor for mapping:[-1,1] to (-511,+511)CS5600 31Combine Screen Transformation 100001005110511051100511xyTxySVCS5600 32For General Screen: …… 10000100210210210021ynynxnxnV)(ynxn CS5600 33Transformation to Std Clipping FrustumCS5600 34Transforming to Std Frustumyx,z),,( baayxz ,CS5600 35Transforming to Std Frustumyx,z),,( baayxz ,),,( bbbCS5600 36Transforming to Std FrustumThe right scale matrix to map to canonical form10000100000000tan1tan11baa10000100000000cotcot1baaCS5600 37Transforming to Std
View Full Document