1 / 85

CSCE 552 Spring 2009

CSCE 552 Spring 2009. Animation. By Jijun Tang. Inverse of 4x4. 2D Example. θ. Rotation Around Arbitrary Vector.

edgardoa
Download Presentation

CSCE 552 Spring 2009

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSCE 552 Spring 2009 Animation By Jijun Tang

  2. Inverse of 4x4

  3. 2D Example θ

  4. Rotation Around Arbitrary Vector • Rotation about an arbitrary vector Counterclockwise rotation about an arbitrary vector (lx,ly,lz) normalised so that                    by an angle α is given by a matrix where

  5. Translation • A 3  3 matrix can reorient the coordinate axes in any way, but it leaves the origin fixed • We must add a translation component D to move the origin:

  6. Homogeneous coordinates • Four-dimensional space • Combines 3  3 matrix and translation into one 4  4 matrix

  7. What is Physics Simulation? • The Cycle of Motion: • Force, F(t), causes acceleration • Acceleration, a(t), causes a change in velocity • Velocity, V(t) causes a change in position • Physics Simulation:Solving variations of the above equations over time to emulate the cycle of motion

  8. Concrete Example: Target Practice Projectile Launch Position, pinit Target

  9. Errors Exact Euler

  10. Overlap Testing Results • Useful results of detected collision • Pairs of objects will have collision • Time of collision to take place • Collision normal vector • Collision time calculated by moving object back in time • until right before collision • Bisection is an effective technique

  11. Bisect Testing: collision detected

  12. Bisect Testing: Iteration I

  13. Bisect Testing: Iteration II

  14. Bisect Testing: Iteration III

  15. Bisect Testing: Iteration IV

  16. Bisect Testing: Iteration V Time right before the collision

  17. Overlap Testing: Limitations Fails with objects that move too fast • Thin glass vs. bulltes • Unlikely to catch time slice during overlap

  18. Intersection Testing (a priori) • Predict future collisions • When predicted: • Move simulation to time of collision • Resolve collision • Simulate remaining time step

  19. Intersection Testing:Swept Geometry • Extrude geometry in direction of movement • Swept sphere turns into a “capsule” shape

  20. Simplified Geometry Approximate complex objects with simpler geometry, like this ellipsoid or bounding boxes

  21. Minkowski Sum By taking the Minkowski Sum of two complex volumes and creating a new volume, overlap can be found by testing if a single point is within the new volume

  22. Minkowski Sum

  23. Using Minkowski Sum

  24. Reduce Number of Detections O(n) Time Complexity can be achieved. One solution is to partition space

  25. Achieving O(n) Time Complexity Another solution is the plane sweep algorithm Requires (re-)sorting in x (y) coordinate

  26. Animation Overview • Fundamental Concepts • Animation Storage • Playing Animations • Blending Animations • Motion Extraction • Mesh Deformation • Inverse Kinematics • Attachments & Collision Detection • Conclusions

  27. Animation Roles • Programmer – loads information created by the animator and translates it into on screen action. • Animator – Sets up the artwork. Provides motion information to the artwork.

  28. Different types of animation • Particle effects • Procedural / Physics • “Hard” object animation (door, robot) • “Soft” object animation (tree swaying in the wind, flag flapping the wind) • Character animation

  29. 2D Versus 3D Animation • Borrow from traditional 2D animation • Understand the limitations of what can be done for real-time games • Designing 3D motions to be viewed from more than one camera angle • Pace motion to match game genre

  30. Animation terms • frame – an image that is displayed on the screen, usually as part of a sequence. • pose – an orientation of an objects or a hierarchy of objects that defines extreme or important motion. • keyframe – a special frame that contains a pose. • tween – the process of going “between” keyframes. • secondary motion – an object motion that is the result of its connection or relationship with another object.

  31. Fundamental Problems • Volume of data, processor limitations • Mathematical complexity, especially for rotations. • Translation of motion

  32. Fundamental Concepts • Skeletal Hierarchy • The Transform • Euler Angles • The 3x3 Matrix • Quaternions • Animation vs Deformation • Models and Instances • Animation Controls

  33. Skeletal Hierarchy • The Skeleton is a tree of bones • Modelling characters • Often flattened to an array in practice • Each bone has a transform, stored relative to its parent’s transform • Top bone in tree is the “root bone” • Normally the hip • May have multiple trees, so multiple roots • Transforms are animated over time • Tree structure is often called a “rig”

  34. Example

  35. The Transform • “Transform” is the term for combined: • Translation • Rotation • Scale • Shear • Can be represented as 4x3 or 4x4 matrix • But usually store as components • Non-identity scale and shear are rare

  36. Examples

  37. Three rotations about three axes Intuitive meaning of values Euler Angles

  38. Euler Angles • This means that we can represent an orientation with 3 numbers • A sequence of rotations around principle axes is called an Euler Angle Sequence • Assuming we limit ourselves to 3 rotations without successive rotations about the same axis, we could use any of the following 12 sequences: XYZ XZY XYX XZX YXZ YZX YXY YZY ZXY ZYX ZXZ ZYZ

  39. Using Euler Angles • To use Euler angles, one must choose which of the 12 representations they want • There may be some practical differences between them and the best sequence may depend on what exactly you are trying to accomplish

  40. Interpolating Euler Angles • One can simply interpolate between the three values independently • This will result in the interpolation following a different path depending on which of the 12 schemes you choose • This may or may not be a problem, depending on your situation • Note: when interpolating angles, remember to check for crossing the +180/-180 degree boundaries

  41. Problems • Euler Angles Are Evil • No standard choice or order of axes • Singularity “poles” with infinite number of representations • Interpolation of two rotations is hard • Slow to turn into matrices • Use matrix rotation

  42. Rotation Matrix

  43. 3x3 Matrix Rotation • Easy to use • Moderately intuitive • Large memory size - 9 values • Interpolation is hard • Introduces scales and shears • Need to re-orthonormalize matrices after

  44. Quaternions • Quaternions are an interesting mathematical concept with a deep relationship with the foundations of algebra and number theory • Invented by W.R.Hamilton in 1843 • In practice, they are most useful to use as a means of representing orientations • A quaternion has 4 components

  45. Quaternions on Rotation • Represents a rotation around an axis • Four values <x,y,z,w> • <x,y,z> is axis vector times sin(angle/2) • w is cos(angle/2) • No singularities • But has dual coverage: Q same rotation as –Q • This is useful in some cases! • Interpolation is fast

  46. Illustration

  47. Quaternions (Imaginary Space) • Quaternions are actually an extension to complex numbers • Of the 4 components, one is a ‘real’ scalar number, and the other 3 form a vector in imaginary ijk space!

  48. Quaternions (Scalar/Vector) • Sometimes, they are written as the combination of a scalar value s and a vector value v where

  49. Unit Quaternions • For convenience, we will use only unit length quaternions, as they will be sufficient for our purposes and make things a little easier • These correspond to the set of vectors that form the ‘surface’ of a 4D hypersphere of radius 1 • The ‘surface’ is actually a 3D volume in 4D space, but it can sometimes be visualized as an extension to the concept of a 2D surface on a 3D sphere

  50. Quaternions as Rotations • A quaternion can represent a rotation by an angle θ around a unit axis a: • If a is unit length, then q will be also

More Related