• No results found

w = COI EYE view direction vector u = w ( 010,, ) cross product with y-axis v = w u up vector

N/A
N/A
Protected

Academic year: 2021

Share "w = COI EYE view direction vector u = w ( 010,, ) cross product with y-axis v = w u up vector"

Copied!
28
0
0

Loading.... (view fulltext now)

Full text

(1)

Computer Animation: Algorithms and Techniques

29

. (EQ 1)

w = COIEYE view direction vector u = w×(0 1 0, , ) cross product with y-axis

v = w×u up vector

(2)

30

Computer Animation: Algorithms and Techniques y

x z

center of interest

up vector

view vector

observer

(3)

Computer Animation: Algorithms and Techniques

31

FIGURE 7. Object to world space transformation and the view frustum in world space.

Object Space

World Space

Object transformed into world space

Center of Interest

Observer

Angle of View Hither Clipping Distance

Yon Clipping Distance

Up V ector

z

x y

z

x y

View Vector

View Frustum

(4)

32

Computer Animation: Algorithms and Techniques

FIGURE 8.Display pipeline showing transformation between spaces.

Object Space

World Space

x y

z

y

z

x

y

Eye Space

x

z y

Image Space eye at negative infinity

Screen Space x z

parallel lines of sight lines of sight

emanating from observer

x y

(5)

Computer Animation: Algorithms and Techniques

33

.

FIGURE 9. Transformation through spaces using ray casting.

Object Space

World Space y

z

y

x

Screen Space x

z

virtual frame buffer

ray constructed through pixel center

(6)

34

Computer Animation: Algorithms and Techniques

(EQ 2)

. (EQ 3)

(EQ 4)

(EQ 5)

. (EQ 6)

(EQ 7)

(EQ 8)

(EQ 9)

x w---- y

w---- z w----

 , , 

  = [x y z w, , , ]

x y z, ,

( ) = [x y z 1, , , ]

x y z 1

1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1

=

x y z 1

x y z 1 = x y z 1

1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1

P' = M1M2M3M4M5M6P M = M1M2M3M4M5M6

P' = MP

P' = PM6TM5TM4TMT3M2TM1T MT = M6TM5TMT4MT3M2TM1T

P' = PMT

x' y' z' 1

a b c d e f g h i j k m 0 0 0 1

x y z 1

=

x+tx y+ty z+tz

1

1 0 0 tx 0 1 0 ty 0 0 1 tz 0 0 0 1

x y z 1

=

(7)

Computer Animation: Algorithms and Techniques

35

(EQ 10)

(EQ 11)

(EQ 12)

(EQ 13)

(EQ 14)

Sxx Syy Szz 1

Sx 0 0 0 0 Sy 0 0 0 0 Sz 0 0 0 0 1

x y z 1

=

S xS yS z⋅ 1

x y z 1 S---

1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 S---

= =

x y z 1

x' y' z' 1

1 0 0 0

0 cosθ sinθ0 0 sinθ cosθ 0

0 0 0 1

x y z 1

=

x' y' z' 1

θ

cos 0 sinθ 0

0 1 0 0

θ sin

– 0 cosθ 0

0 0 0 1

x y z 1

=

x' y' z' 1

θ

cos –sinθ0 0 θ

sin cosθ 0 0

0 0 1 0

0 0 0 1

x y z 1

=

(8)

36

Computer Animation: Algorithms and Techniques

FIGURE 10. Desired Position and Orientation.

z

y

x

z

y

x

(20, -10, 35)

(23,-14,40)

a) Object space definition b) World space position and orientation of aircraft up vector

(9)

Computer Animation: Algorithms and Techniques

37

.

FIGURE 11. Projection of desired orientation vector onto y-z plane.

Y

Z

(-4,5) -4

5 ψ

(10)

38

Computer Animation: Algorithms and Techniques .

FIGURE 12. Projection of desired orientation vector onto x-z plane.

Z

X (3,5)

5

3 φ

(11)

Computer Animation: Algorithms and Techniques

39

FIGURE 13. Global coordinate system and unit coordinate system to be transformed.

z

y

x

Z

X Y

x,y,z - global coordinate system X,Y,Z - deisred orientation defined by

unit coordinate system

(12)

40

Computer Animation: Algorithms and Techniques

(EQ 15)

(EQ 16)

(EQ 17)

X = M xXx

Xy Xz

M

= 1 0 0

Y = M yYx

Yy Yz

M 0 1 0

=

Z = M zZx

Zy Zz

M 0 0 1

=

XxYxZx XyYyZy Xz Yz Zz

M

1 0 0 0 1 0 0 0 1

=

Xx YxZx Xy YyZy Xz Yz Zz

M

=

x' y' z' 1

A11 A12 A13 A14 A21 A22 A23 A24 A31 A32 A33 A34

0 0 0 1

x y z 1

=

(13)

Computer Animation: Algorithms and Techniques

41

.

FIGURE 14. Translation of moon out to its initial position on the x-axis.

(r,0,0) x

y

z z

x y

(14)

42

Computer Animation: Algorithms and Techniques

FIGURE 15. Rotation by applying incremental rotation matrices to points.

(r,0,0)

1 2 3

Rdy= y-axis rotation of 5 degrees for each point P’ of the moon { record a frame of the animation

P’ = Rdy*P’

for each point P of the moon { P’ = P

z

x y

repeat until (done) {

} } }

(15)

Computer Animation: Algorithms and Techniques

43

FIGURE 16. Rotation by incrementally updating the rotation matrix.

(r,0,0) 1 2

3 R = identity matrix

Rdy= y-axis rotation of 5 degrees

R = R*Rdy

record a frame of the animation P’ = R*P

for each point P of the moon { y

x z

repeat until (done) {

}

}

(16)

44

Computer Animation: Algorithms and Techniques

FIGURE 17. Rotation by forming the rotation matrix new for each frame.

(r,0,0) 1 2 3

y = 0

record a frame of the animation P’ = R*P

for each point P of the moon {

R = y-axis rotation matrix of ‘y’ degrees

y = y+5 y

x z

repeat until (done) {

} }

(17)

Computer Animation: Algorithms and Techniques

45

.

FIGURE 18. Orthonormalization.

Step 1: Normalize one of the vectors

Step 2:

Form vector perpendicular (orthogonal) and to one of the other two original vectors Normalize it.

Step 3:

Form the final orthogonal vector by taking the cross product of the two just generated.

Normalize it.

to the vector just normalized by taking cross product of the two.

the original unit orthogonal vectors each other due to repeated transformations have ceased to be orthogonal from

(18)

46

Computer Animation: Algorithms and Techniques .

FIGURE 19. Direct interpolation of transformation matrix values can result in nonsense.

0 0 1 0 1 0

1 – 0 0

0 0 –1 0 1 0 1 0 0

a) Positive 90 degree y-axis rotation b) Negative 90 degree y-axis rotation

c) Half way between orientation representations 0 0 0

0 1 0 0 0 0

(19)

Computer Animation: Algorithms and Techniques

47

.

FIGURE 20. Fixed angle representation.

z

y

x

z

y

x

(20)

48

Computer Animation: Algorithms and Techniques

FIGURE 21. Fixed angle representation of (0,90,0).

x y

z

x y

z

a) Original definition b) (0,90,0) orientation

(21)

Computer Animation: Algorithms and Techniques

49

.

FIGURE 22. Effect of slightly altering values of fixed angle representation (0,90,0).

x y

z (+/-ε,90,0) orientation

x y

z

(0,90+/-ε,0) orientation

x y

z

(0,90,+/-ε) orientation

a) b) c)

(22)

50

Computer Animation: Algorithms and Techniques

FIGURE 23. Example orientations to interpolate.

x y

z

(0,90,0) orientation

x y

z

(90,45,90) orientation; the object lies in the y-z plane

(23)

Computer Animation: Algorithms and Techniques

51

.

FIGURE 24. Euler angle representation.

X Y

Z

x y

z

Global coordinate system

Local Coordinate system attached to object yaw

pitch roll

(24)

52

Computer Animation: Algorithms and Techniques

(EQ 18)

(EQ 19)

Ry'( )Rβ x( )α = Rx( )Rα y( )Rβ x( )Rα x(–α)= Rx( )Rα y( )β

Rz''( )Rγ y'( )Rβ x( )α = Rx( )Rα y( )Rβ z( )Rγ y(–α)Rx(–β)Ry( )Rβ x( )α = Rx( )Rα y( )Rβ z( )γ

(25)

Computer Animation: Algorithms and Techniques

53

FIGURE 25. Euler’s Rotation Theorem implies that, for any two orientations of an object, one can be produced from the other by a single rotation about an arbitrary axis.

X Y

Z

X Y

Z

θ

orientation A orientation B

angle and axis of rotation

(26)

54

Computer Animation: Algorithms and Techniques

!

FIGURE 26. Interpolating axis-angle representations.

X Y

Z

θ1

Α1

Α2 θ2

B=A1xA2

φ φ cos1 A1A2

A1 A2 ---

 

 

=

Ak = RB(k⋅φ) A1 θk = (1–k) θ⋅ 1+k⋅θ2

B = A1×A2

(27)

Computer Animation: Algorithms and Techniques

55

.

(EQ 20)

(EQ 21)

(EQ 22)

(EQ 23)

(EQ 24)

(EQ 25)

(EQ 26)

(EQ 27)

(EQ 28)

27.

s1,v1

[ ]⋅[s2,v2] = [s1s2v1v2,s1v2+s2v1+v1×v2]

0 v, 1

[ ]⋅[0 v, 2] = [0 v, 1×v2] iff v1v2 = 0

q1 = (1⁄ q )2⋅[s,–v] where q = s2+x2+y2+z2

q q

q⁄( q )

v' = Rot v( ) = q1⋅ ⋅v q

Rotq(Rotp( )v) = q1⋅(p1⋅ ⋅v p)⋅q ( )pq 1⋅ ⋅v ( )pq

( )

=

Rotpq( )v

=

Rot1(Rot v( )) = q⋅(q1⋅ ⋅v q)⋅q1 = v

q = Rotθ,(x y z, , ) = [cos(θ⁄2),sin(θ⁄2)⋅(x y z, , )]

q

– = Rotθ,(x y z, , ) θ – ⁄2

( )

cos ,sin(( )–θ ⁄2)⋅(–(x y z, , ))

[ ]

=

θ⁄2

( )

cos ,–sin(θ⁄2)⋅(–(x y z, , ))

[ ]

=

θ⁄2

( )

cos ,sin(θ⁄2)⋅x y z, ,

[ ]

=

Rotθ,(x y z, , )

= q

=

(28)

56

Computer Animation: Algorithms and Techniques

References

Related documents

reversed and held: (1) a text message is a “call” under TCPA; (2) an ATDS is any equipment with capacity to store, produce, or call random or sequential numbers; and

The right hand rule can similarly give you the direction of any orthogonal vector based on the cross-product of 2 vectors.. (We often use this to visualize cross products in order

A minimal surface spanning a given contour Γ is the differentiable surface with the boundary curve Γ, which is represented by a harmonic vector j(w, v) and for which (u y v)

Regarding Green Chemistry area, we used Graphene Acid (GA) as starting material and we exploited its uniform surface functionalization to prepare materials

The evidence supports the key qualitative prediction of the Baron and Ferejohn legislative bargaining model: members with proposal power, those sitting on the

ND280 CONSTRAINT ON THE NEUTRINO FLUX AND CROSS SECTION MODELS The rate of neutrino interactions measured at the ND280 detector has power to constrain the neutrino flux and

The direction of the new unit vector obtained by the cross product of two unit vectors is obtained with the help of figure 3.26(a).. The direction of the cross product of i  j

The cross product is defines based on the coordinates of the vectors, but vectors were introduced in- dependent from their coordinates raising the question if the cross product