Download presentation
Presentation is loading. Please wait.
1
Week 4 Lecture 3: Character Animation Based on Interactive Computer Graphics (Angel) - Chapter 10 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009
2
2 Objectives Standard Hierarchical models not good enough for realistic characters Skeletal animation Skinning Introduce Cal3d
3
Humanoid Recall our humanoid: Each section separate geometry. Some movements reveal gaps / overlaps in geometry. Geometry stays the same shape during transformation. Fine for a basic robot…
4
Human Motion Humans… Continuous Geometry No Gaps or Overlaps during movement Geometry deforms How to do this for computer characters?
5
Human Anatomy Humans are made up of skeleton, muscles and skin. We only care about the cumulative effect of internal mechanism i.e. the skin. Can we simulate the effect of muscles and skeleton?
6
Skeletal Animation One answer is to use a skeletal animation system, which means we manipulate a skeleton (a series of bones), and this produces a desired effect on the skin (a polygon mesh). Some more advanced systems also simulate muscle structure. We will just cover bones and skinning.
7
Bones Basics Bones in 3D mimic joints, rather than actual bones. Bones are in a tree hierarchy. There is one root bone, and all bones are children of that bone, or children of it's children. Assuming the hip is the root bone, you might then have three children, left thigh, right thigh, midsection etc. Many modelling packages such as 3d studio have a standard set of bones. Bone movements are controlled by rotations.
8
Forward Kinematics Recall our Robot arm. The position of the arm can be determined from a series of rotations. Rotation at the “base” Rotation at the “shoulder” Rotation at the “elbow” Forward kinematics means determining the position of a vertex after the chain of rotations.
9
Inverse Kinematics The opposite of forward kinematics. The final position and orientation is known, but the series of rotations to get there must be calculated. Can lead to multiple possible solutions, some of which are physically impossible. Some solutions make no sense for human skeleton, and human behaviour. Required often in games, when hand, foot etc. need to be in correct place (e.g. fighting games, sports games).
10
Skinning The skin is represented as a polygon mesh, e.g. a set of vertices. Each vertex is associated with a bone in the skeleton, and moves relative to that bone. Vertices near joints are connected to multiple bones with a weighting system, e.g. at the elbow a vertex may move 60% in proportion to upper arm and 40% with lower arm.
11
3d Studio Skinning Blue = vertex “groups”. Inner White = geometry. Outer White = Bounding boxes. Red / Yellow = Bones. Green points = vertices affected by current (red) bone.
12
Why Use Skeletal Animation? Minimises work needed to do an animation: Due to hierarchy, child bones move when parent bones are moved. Animations stored as a series of joint rotations (in quaternions), more efficient storage than whole vertex sets. Produces smoother more realistic animation. Quaternions produce smooth animation when interpolated, without gimbal lock.
13
3d studio example http://uk.youtube.com/watch?v=r4H_LKV6 NJA&feature=related
14
Quaternions Another way to represent rotations rather than a matrix. Uses complex number mathematics to represent axis. A quaternion is represented as a scalar value and a vector value: q= w + ai + bj + ck = cos(ang/2) + sin(ang/2)u
15
Using Quaternions The conjugate or inverse of a quaternion: q -1 = q->scalar + -(q->vector) Magnitude of a quaternion: |q| = sqrt(q*q -1 ) To normalise a quaternion: q->scalar/|q| + (q->vector)/|q| To rotate a point v around unit axis u, apply the quaternion multiplication: qvq -1
16
Using Quaternions Cont. To convert an axis and angle (ang) to a quaternion (q) – should normalise afterwards. sin_a = sin(ang/2) cos_a = cos(ang/2) q->x = axis->x * sin_a q->y = axis->y * sin_a q->z = axis->z * sin_a q->w = cos_a
17
Animation Blending Animations stored as series of rotations applied to specific joints. Animations that work on different joints (including children) can run simultaneously without interference e.g. walk and wave. Animations that affect the same joints can run simultaneously, but will interfere. Use a normalised weighting system to tell joints how much of each animation to apply.
18
Cal3d C++ Library for character animation. Exports from 3d studio, maya, (blender?) etc. Supports model loading, texturing, animation blending etc. http://uk.youtube.com/watch?v=LLzU23xJ rhg&feature=relatedhttp://uk.youtube.com/watch?v=LLzU23xJ rhg&feature=related
19
Practical? Have a play around with cal3d: http://home.gna.org/cal3d/
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.