From BlenderWiki

Jump to: navigation, search

[edit] Introduction

Level
basic

Recommended pre-requisites: working knowledge of Blender's interface, keyframing and ipo curves editing.


[edit] About

In this tutorial we will play with giving the illusion of weight in animations, counting only with a good sense of motion and timing, plus how to apply these using keyframing and editing ipo curves points.

Time to make some spheres collide with each other.

[edit] File

.blend file


[edit] Tutorial

[edit] Basic Setup

Let's keep this very simple. To start we only need two spheres. The ones used here are 16x16 UV spheres, but that doesn't really matter. Since we won't deform them, it's ok to use the same mesh for all spheres in this exercise.

  1. Add a sphere:
    SPACE >> Add >> Mesh >> UV Sphere.
    Leave Segments and Rings at default values or set to less than that if you prefer, we just need them to look like spheres.
  2. Duplicate it:
    Alt D for a linked (same mesh) duplicate.
    Move the copy 10 unities to the left in X.

We have two spheres, one at the center of the 3D space (0, 0, 0) and the other 10 unities to the left of the origin in X (-10, 0, 0). That's enough to start.

[edit] And Basic Keyframing

Let's make the left sphere collide with the other, which we won't move at all at first. With this we assume the sphere at the origin is much heavier than the other one (or maybe it's stuck there!).

1) At frame #11 the spheres are about to touch.
  1. Set starting frame, if needed: 1.
  2. Select the left sphere and keyframe its position.
    I Insert Key>>Loc.
  3. Set current frame to 11:
    Up to advance by 10 frames (in any window, except the Text Editor or Scripts ones).
  4. Move the left sphere in X and place it right next to the other one, "touching" it. In our example that means putting it at X=-2.
    GX or use the Transform Properties panel (N in the 3D View window). Image #1 at the right shows an example.
  5. Insert another location (Loc) keyframe for the left sphere at this point.
  6. Advance 20 frames now, to frame #31.
    Up twice.
  7. Move the left sphere some unities back in X, as if it had rebounded after colliding with the sphere at rest. We've used X=-6 for the new position.
  8. At this point we can return to frame #1 and play the animation in a 3D View window:
    Alt A.

The left sphere should start at X=-10, move to X=-2 to touch the other sphere, then rebound to X=-6. The only problem is that the movement doesn't look natural at all.

This is our X location ipo curve for the left sphere:

2) Original LocX interpolation curve for the left sphere.

Look at the curve above piece by piece, as if it were made of many small straight segments. The more vertical a segment is, the faster the animation (movement in X, since this is a LocX curve) is in that interval. The closer to horizontal, the slower -- straight lines mean constant variation and horizontal ones mean no (constant = zero) variation at all. So, for instance, we can see that the moving sphere starts slowly from rest at frame #1, accelerates and then basically keeps a constant speed from frame #4 to #7 or so and then slows down before reaching frame #10.

Interpolation
by default Blender uses Bezier (smooth) interpolation to link keyframes. This gives us basic Slow out and Slow in.


But in this case it doesn't look good at all. The sphere should not accelerate from rest as if it had a force acting on it. We assume it's been thrown somehow, so its speed should only decrease after it starts moving, due to friction and some energy lost in the collision.

[edit] Ipo Curve Editing

Let's improve the animation by editing the animation curve directly.

  1. Open an Ipo Curve Editor window and right-click to select the LocX curve of the left sphere (select the sphere first, if it's not already active).
  2. Enter curve edit mode:
    TAB
  3. Select the right segment of the first point in the curve and turn it to a vector:
     RMB Image:Template-RMB.png to select, V to set the handle type to vector. This takes care of the undesired slowing out of the first extreme.
  4. Select the whole middle point and set its handle type to vector, too, as shown in image #3 below. Image #4 shows the result.
3) Point mode: the selected handles were set to type vector.
4) Curve mode: the resulting animation curve after our changes.

The movement of the left ball should look more natural, now. But there's always room to tweak and experiment...

[edit] Sense of Weight

As mentioned above, this first examples gives the impression that the left ball is much lighter than the one it hits, since it's not able to move it at all. Or that the ball at the origin is stuck there, somehow. Of course we can clear up the doubt by giving this heavy ball a little bit of movement, too. Or make it seem lighter (and the other heavier, in comparison) by making it move more.

So our next step is to make the ball at the origin react to the collision:

  1. Go to frame #11, where they collide, and insert a location keyframe for the right sphere in its current position.
  2. Advance to the next keyframe (#31) and place this sphere a little more to the right. Insert another location keyframe. The farther from the origin, the lighter it will seem (the more momentum it will have picked from the collision).
  3. Edit the curve until you're satisfied with the animation. Figure #5 shows an example (it's a good idea to be able to understand what goes on in the animation from looking at curves like this one).
Hint
translate the final keyframes so that the spheres don't stop at the same frame (time), that gives a more realistic touch.


5) A possible LocX curve for the right sphere, being hit at frame #11.

In this tutorial's .blend file we have 3 cases, the one we created above and two others, where the ball that is hit also moves. In all of them the ball at the left collides in the X axis with the ball at its right, like shown in images #6 and #7 below. The animation curves were tweaked to make the balls stop at slightly different times and places to make it all more believable.

6) Spheres about to collide at frame #11.
7) A few frames after the collisions.
Momentum transfer
the movement of the ball that is hit comes from momentum it picks from the other ball, which should then slow down accordingly.


[edit] Suggested Exercises

  1. Reproduce and tweak these simple collisions trying different possibilities: different sizes, other objects, etc.
  2. Our examples only use the X axis. Create two-dimensional collisions.
  3. George Maestri, in his [Digital] Character Animation 2: Volume 1 book, uses the example of a sphere hitting one face of a cube:
    1. A much heavier cube doesn't move at all, the sphere hits and rebounds.
    2. A much heavier sphere hits the cube and continues as if nothing had happened, the cube rotates away when hit.
  4. Suggested animations:
    1. Billiard game
    2. Pinball game

[edit] Conclusion

Well, this was surely as simple as it gets. And not very useful in practice, it's generally better to let Blender simulate the collisions itself, using rigid body Physics.

But practicing these exercises should give you a good sense of weight that can be applied in more complex cases, like a character interacting with light or heavy objects, like when pushing, kicking or being hit, for example.

As always, paying attention to how good animators deliver a sense of weight in their work is a good helper, too.

[edit] Notes

[edit] Simulating

In practice, trivial examples like these (and even much more complex ones) are better left to rigid body simulations.

Game engine examples:

[edit] Theory

It's a good idea now to learn or remember what you know about elastic and inelastic collisions. Note: those links have nice animations to showcase the possibilities.


Summer of documentation 2006 -- Willian 01:56, 20 August 2006 (CEST)

{{UM/foot|BSoD/Introduction_to_the_Principles_of_Animation/Tutorials||}