# 681 - Introduction to Computer Graphics

Computer Animation Algorithms and Techniques Technical Background Rick Parent Computer Animation Spaces and Transformations Left-handed v. right handed Homogeneous coordinates: 4x4 transformation matrix (TM) Concatenating TMs Basic transformations (TMs) Display pipeline Rick Parent x y z 1 Computer Animation

Displa y Object space to world space (TM) Pipelin World Space Data e World space to eye space (TM) Object Space Data Eye Space Data Image space to display space (TM) Perspective (TM) Clipping Perspective Divide Image Space Data Display Space Data Rick Parent Computer Animation Representing an orientation Example: fixed angles - rotate around global axes

Y Orientation: X P ' Rz () R y ( ) Rx ( ) P Z Rick Parent Computer Animation Working with fixed angles and Rotation Matrices (RMs) Orthonormalizing a RM Y Extracing fixed angles from an orientation

Z Extracing fixed angles from a RM Y X X Z Rick Parent Making a RM from fixed angles Making a RM from transformed unit coordinate system (TUCS) Computer Animation Transformations in pipeline object -> world: often rigid transforms world -> eye: rigid transforms perspective matrix: uses 4th component of homo. coords perspective divide image -> screen: 2D map to screen coordinates Clipping: procedure that considers view frustum

Rick Parent Computer Animation Error considerations Accumulated round-off error - transform data: transform world data by delta RM update RM by delta RM; apply to object data update angle; form RM; apply to object data orthonormalization rotation matrix: orthogonal, unit-length columns iterate update by taking cross product of 2 vectors scale to unit length considerations of scale miles-to-inches can exeed single precision arithmetic Rick Parent Computer Animation Orientation Representation Rotation matrix Fixed angles: rotate about global coordinate system Euler angles: rotate about local coordinate system Axis-angle: arbitrary axis and angle Quaternions: mathematically handy axis-angle 4-tuple

Exponential map: 3-tuple version of quaternions Rick Parent Computer Animation Transformation Matrix a e i m Rick Parent b f j n c g k o

d h l p Computer Animation Transformation Matrix a e i 0 Rick Parent b f j 0 c tx g ty

k tz 0 1 Computer Animation Rotation Matrices 0 0 1 0 cos sin 0 sin cos 0 0 0 0 0 0 1 cos

0 sin 0 0 0 0 1 0 sin 1 0 0 cos 0 0 cos sin sin cos 0 0 0

0 Rick Parent 0 0 1 0 0 0 0 1 Computer Animation Y Fixed Angles X Z

P' Rz () R y ( ) Rx ( ) P Fixed order: e.g., x, y, z; also could be x, y, x Global axes Rick Parent Computer Animation Gimbal Lock 0 0 0 Fixed angle: e.g., x, y, z 0 90 0 Y Y X

X Z Rick Parent Z Computer Animation Gimbal Lock 0 Fixed order of rotations: x, y, z 90 0 What do these epsilon rotations do? Y 0 90 0 90 0

0 X 0 90 0 Z Rick Parent Computer Animation Gimbal Lock 0 90 0 90 0 90 Y Y

X X Z Z Interpolating FA representations does not produce intuitive rotation because of gimbal lock Rick Parent Computer Animation Euler Angles Y X Prescribed order: e.g., x, y, z or x, y, x

Rotate around (rotated) local axes Z Note: fixed angles are same as Euler angles in reverse order and vice versa Rick Parent P' Rx ( ) R y ( ) Rz () P Computer Animation Axis-Angle A x Y Q A

y X z Z Rotate about given axis Eulers Rotation Theorem OpenGL Fairly easy to interpolate between orientations Difficult to concatenate rotations Rick Parent Computer Animation Axis-angle to rotation matrix Y Q A X Z

Rick Parent Concantenate the following: Rotate A around z to x-z plane Rotate A around y to x-axis Rotate theta around x Undo rotation around y-axis Undo rotation around z-axis Computer Animation Axis-angle to rotation matrix ax ax A a a y x az ax 0 * A a z ay Rot( Rick Parent

x y ax a y ayay az a y az 0 ax z ) ax az a y az a z az ay ax 0 Y A Q

P X P Z A cos( )( I A ) sin( ) A* Computer Animation Quaternion Rot A Y cos sin( ) * A 2 2

Q A X Same as axis-angle, but different form Still rotate about given axis Mathematically convenient form s q Rick Parent v Z Note: in this form v is a scaled version of the given axis of rotation, A Computer Animation Quaternion Arithmetic Addition s1 s2

v1 v2 s1 v1 s2 v2 Multiplication q1q2 s1s2 v1 v2 Inner Product Length Rick Parent s2 v1 s1v2 v1 v2 q1 q2 s1s2 v1 v2 q q q Computer Animation Quaternion Arithmetic Inverse 1 q 1

q 2 s qq 1 q 1q 1 pq Unit quaternion Rick Parent 1 1 v 0 q p q 0 0

1 q q Computer Animation Quaternion Represention Vector Transform Rick Parent 0 v v' Rot q (v) qvq 1 Computer Animation Quaternion Geometric Operations Rot q (v) Rot q (v)

Rotq (v) Rot kq (v) v Rotq ( Rot p (v)) Rotqp (v) 1 1 v Rotq 1 ( Rotq (v)) q (qvq )q v Rick Parent Computer Animation Unit Quaternion Conversions Rot s x z y 1 2 y 2 2 z 2 2 xy 2sz 2 xz 2 sy

2 2 2 xy 2 sz 1 2x 2z 2 yz 2sx 2 2 2 xz 2sy 2 yz 2 sx 1 2 x 2 y Axis-Angle

Rick Parent 2 cos 1 ( s ) ( x, y, z ) v / v Computer Animation Quaternions Avoid gimbal lock Easy to rotate a point Easy to convert to a rotation matrix Easy to concatenate quaternion multiply Easy to interpolate interpolate 4-tuples How about smoothly (in both space and time) interpolate? Rick Parent Computer Animation

## Recently Viewed Presentations

• arial trebuchet ms calibri motyw pakietu office coreldraw 12.0 graphic slajd 1 proevent jesteŚmy proeventowi wyjazdy usa usa wyspy kanaryjskie wyspy kanaryjskie wŁochy wŁochy austria austria konferencje ryga ryga licheŃ licheŃ wzgÓrza dylewskie wzgÓrza dylewskie imprezy boogie night boogie night...
• M A M J 72 105 103 80 64 70 116 193 283 200 176 163 '16 - '17 J A S O N D J F M A M J 209 166 129 255 141 221 237 374 Variance...
• SQA mandatory key information. Increased variation through the production of haploid gametes by meiosis -meiosis I, meiosis II, gamete mother cell, chromosome, chromatid, homologous pairs, crossing over, chiasmata, independent assortment, linked genes and frequency of recombination.
• The Goals, Operators, Methods, and Selection rules (GOMS) model was developed by Card, Moran and Newell in the mid-1970's (Card et al., 1980; 1983). The GOMS model has four components: ... Chapter 4 Finding out about tasks and work
• Auxin (IAA) Effects controls cell division & differentiation phototropism growth towards light asymmetrical distribution of auxin cells on darker side elongate faster than cells on brighter side apical dominance Cytokinins Cytokinins are so named because they stimulate cytokinesis (cell division)...
• jhe meauc pul eqo wau bp1 mnu cgu he1 teu ixa rbn osu uv0 cma uat upm stf pmn nar pau uau uby huh yus clart lhl zcu ibv dlc rx3 muq smi cud jpg csl aud myg qgk bmf...
• Community Ecology Community Group of individuals from different species in a given area Species Richness Relative abundance Interspecific Interactions Interaction Ind. # 1 Ind. # 2 Competition - - Predation + - Mutualism + + Commensalism + 0 Competition Interspecific...
• The Reheat Regenerative Rankine Cycle. 10-49. A steam power plant operates on an ideal reheat-regenerative Rankine cycle and has a net power output of 80 MW. Steam enters the high-pressure turbine at 10 MPa and 550°C and leaves at 0.8...