. w COI EYE view direction vector u w ( 00,, ) cross product with -ais v w u up vector (EQ ) Computer Animation: Algorithms and Techniques 29
up vector view vector observer center of interest 30 Computer Animation: Algorithms and Techniques
Object Space Object transformed into world space Yon Clipping Distance Hither Clipping Distance Up Vector Observer Angle of View View Vector Center of Interest World Space View Frustum FIGURE 7. Object to world space transformation and the view frustum in world space. Computer Animation: Algorithms and Techniques 3
Object Space World Space lines of sight emanating from observer Ee Space ee at negative infinit parallel lines of sight Image Space Screen Space FIGURE 8. Displa pipeline showing transformation between spaces. 32 Computer Animation: Algorithms and Techniques
. virtual frame buffer Object Space ra constructed through piel center World Space Screen Space FIGURE 9. Transformation through spaces using ra casting. Computer Animation: Algorithms and Techniques 33
--- w w ---,, --- [,,, w] w (EQ 2). (,, ) [,,, ] (EQ 3) 000 000 000 000 (EQ 4) 000 000 000 000 (EQ 5). P' M M 2 M 3 M 4 M 5 M 6 P M M M 2 M 3 M 4 M 5 M 6 P' MP (EQ 6) P' PM T 6 M T 5 M T 4 M T 3 M T T 2 M M T M T 6 M T 5 M T 4 M T 3 M T T 2 M P' PM T (EQ 7) ' ' ' abcd e f g h i j k m 000 (EQ 8) + + + t t t 00t 00t 00t 000 (EQ 9) 34 Computer Animation: Algorithms and Techniques
S S S S 0 0 0 0 S 0 0 0 0 S 0 0 0 0 (EQ 0) S S S -- S 000 000 000 000 S -- (EQ ) ' ' ' 0 0 0 0 cosθ sinθ 0 0 sinθ cosθ 0 0 0 0 (EQ 2) ' ' ' cosθ 0 sinθ 0 0 0 0 sinθ 0 cosθ 0 0 0 0 (EQ 3) ' ' ' cosθ sinθ 0 0 sinθ cosθ 0 0 0 0 0 0 0 0 (EQ 4) Computer Animation: Algorithms and Techniques 35
up vector (23,-4,40) (20, -0, 35) a) Object space definition b) World space position and orientation of aircraft FIGURE 0. Desired Position and Orientation. 36 Computer Animation: Algorithms and Techniques
. Y Z -4 5 ψ (-4,5) FIGURE. Projection of desired orientation vector onto - plane. Computer Animation: Algorithms and Techniques 37
. Z 3 5 φ (3,5) X FIGURE 2. Projection of desired orientation vector onto - plane. 38 Computer Animation: Algorithms and Techniques
Y X,, - global coordinate sstem Z X,Y,Z - deisred orientation defined b unit coordinate sstem FIGURE 3. Global coordinate sstem and unit coordinate sstem to be transformed. Computer Animation: Algorithms and Techniques 39
X M Y M Z M X X X M 0 0 Y Y Y M 0 0 Z Z Z M 0 0 (EQ 5) X Y Z X Y Z X Y Z M 00 00 00 X Y Z X Y Z M (EQ 6) X Y Z ' ' ' A A 2 A 3 A 4 A 2 A 22 A 23 A 24 A 3 A 32 A 33 A 34 0 0 0 (EQ 7) 40 Computer Animation: Algorithms and Techniques
. (r,0,0) FIGURE 4. Translation of moon out to its initial position on the -ais. Computer Animation: Algorithms and Techniques 4
3 (r,0,0) 2 for each point P of the moon { P P } R d -ais rotation of 5 degrees repeat until (done) { for each point P of the moon { P R d *P } record a frame of the animation } FIGURE 5. Rotation b appling incremental rotation matrices to points. 42 Computer Animation: Algorithms and Techniques
3 R identit matri R d -ais rotation of 5 degrees 2 repeat until (done) { for each point P of the moon { P R*P } record a frame of the animation R R*R d } (r,0,0) FIGURE 6. Rotation b incrementall updating the rotation matri. Computer Animation: Algorithms and Techniques 43
3 (r,0,0) 2 0 repeat until (done) { R -ais rotation matri of degrees for each point P of the moon { P R*P } record a frame of the animation +5 } FIGURE 7. Rotation b forming the rotation matri new for each frame. 44 Computer Animation: Algorithms and Techniques
. Step :Normalie one of the vectors the original unit orthogonal vectors have ceased to be orthogonal from each other due to repeated transformations Step 2: Form vector perpendicular (orthogonal) to the vector just normalied and to one of the other two original vectors b taking cross product of the two. Normalie it. Step 3: Form the final orthogonal vector b taking the cross product of the two just generated. Normalie it. FIGURE 8. Orthonormaliation. Computer Animation: Algorithms and Techniques 45
. 0 0 0 0 0 0 00 0 0 0 0 a) Positive 90 degree -ais rotation b) Negative 90 degree -ais rotation 000 00 000 c) Half wa between orientation representations FIGURE 9. Direct interpolation of transformation matri values can result in nonsense. 46 Computer Animation: Algorithms and Techniques
. FIGURE 20. Fied angle representation. Computer Animation: Algorithms and Techniques 47
a) Original definition b) (0,90,0) orientation FIGURE 2. Fied angle representation of (0,90,0). 48 Computer Animation: Algorithms and Techniques
. a) (+/-ε,90,0) orientation b) (0,90+/-ε,0) orientation c) (0,90,+/-ε) orientation FIGURE 22. Effect of slightl altering values of fied angle representation (0,90,0). Computer Animation: Algorithms and Techniques 49
(0,90,0) orientation (90,45,90) orientation; the object lies in the - plane FIGURE 23. Eample orientations to interpolate. 50 Computer Animation: Algorithms and Techniques
. aw roll Y X pitch Z Global coordinate sstem Local Coordinate sstem attached to object FIGURE 24. Euler angle representation. Computer Animation: Algorithms and Techniques 5
R '( β)r ( α) R ( α)r ( β)r ( α)r ( α) R ( α)r ( β) R ''()R γ '( β)r ( α) R ( α)r ( β)r ()R γ ( α)r ( β)r ( β)r ( α) R ( α)r ( β)r () γ (EQ 8) (EQ 9) 52 Computer Animation: Algorithms and Techniques
orientation A Y orientation B Y θ angle and ais of rotation X X Z Z FIGURE 25. Euler s Rotation Theorem implies that, for an two orientations of an object, one can be produced from the other b a single rotation about an arbitrar ais. Computer Animation: Algorithms and Techniques 53
! BA A 2 Y θ Α Α 2 φ θ 2 B A A 2 φ cos A ------------------ A 2 A A 2 X A k R B ( k φ)a Z θ k ( k) θ + k θ 2 FIGURE 26. Interpolating ais-angle representations. 54 Computer Animation: Algorithms and Techniques
. [ s, v ] [ s 2, v 2 ] [ s s 2 v v 2, s v 2 + s 2 v + v v 2 ] (EQ 20) [ 0, v ] [ 0, v 2 ] [ 0, v v 2 ] iff v v 2 0 (EQ 2) ( q ) 2 [ s, v] q where q s 2 + 2 + 2 + 2 (EQ 22) q q q ( q ) (EQ 23) v' Rot() v q v q (EQ 24) Rot q ( Rot p () v ) q ( p v p ) q (( pq) v ( pq )) Rot pq () v (EQ 25) Rot ( Rot() v ) q ( q v q ) q v (EQ 26) q Rot θ, (,, ) [ cos( θ 2), sin( θ 2) (,, ) ] (EQ 27) q Rot θ, (,, ) [ cos( θ 2), sin( ( θ) 2) ( (,, ) )] [ cos( θ 2), sin( θ 2) ( (,, ) )] [ cos( θ 2), sin( θ 2),, ] Rot θ, (,, ) q (EQ 28) 27. Computer Animation: Algorithms and Techniques 55
56 Computer Animation: Algorithms and Techniques