Piston Animation Using IK

About Inverse Kinematics (IK)

In an object hierarchy, parents normally transform their children as they are themselves transformed. For example, when a parent rotates 90°, its child also rotates 90°. These transformations are defined by rotation around pivot points and motion and scaling along pivot axes. Each object applies its parent’s transformation to its own. This way, all of the objects in the hierarchy get transformed. This method of applying transformation is called forward kinematics.

In order to have the objects at the end of the hierarchy do something particular, it may be necessary to add additional keyframes to objects in the middle of the chain. This is rarely accurate and usually has to be redone every time something changes. To avoid this, a system must be applied that will let objects at the end of the chain achieve the transformation (movement, scaling, rotation) goal. Since this involves working out the motion from the goals back to the beginning of the chain, this system is called inverse kinematics (IK).

An IK structure is basically a chain of parent/child relationships between objects having a start and stop (goal) point. IK calculates the behavior of the objects in the chain.

An IK structure is basically a chain of parent/child relationships between objects having a start and stop (goal) point. IK calculates the behavior of the objects in the chain.

Use IK to Animate a Piston

In this section, you will use Bongo 2.0 to animate a piston.

Before you start, if you don’t have any previous experience with Bongo. You might want to have a look at how animation hierarchies works in Bongo 2.

Open the example model

Piston
  1. Open the model PistonStart.3dm. If the download doesn’t start automatically, copy the link (right click and choose Copy link address) and paste it into a new tab/window for the download to start.
  2. From the Bongo menu or toolbar, open the Timeline and Animation Manager.

We will link parts of the piston together and control it’s movements through these links.

  1. From the Bongo Menu Select Utilities > Link Chain or use the BongoLinkChain command or click on the Link Chain icon in the toolbar. Link Chain icon
  2. At the Select Parent prompt, select the base (Object 0). At the Select Point To Move Pivot To prompt. Select the end of the line by having Osnap to End on, see image below.


    Select nr 1
  3. At the Select new link prompt, select the next part of the piston - the long arm (Object 1). At the Select Point To Move Pivot To prompt. Select the point down in the middle by having Osnap to Point on, see image below. Select nr 2
  4. At the Select new link prompt, select the next part of the piston - the top (Object 2). At the Select Point To Move Pivot To prompt. Select the point down in the middle by having Osnap to Point on, see image below. Select nr 3
  5. At the Select new link prompt, press Enter to end the command.
  6. From the Bongo Menu Select Utilities > Select Children or use the BongoSelectChildren command or click on the Select Children icon in the toolbar. Select Children icon
  7. At the Select Parent prompt, select the the long arm (Object 1).
  8. At the Select Children prompt, select the point (Point 2) down in the middle of the top by having Osnap to Point on. Select nr 4
  9. At the Select Children prompt, press Enter to end the command.

Now your hierarchy tree in the Animation Manager should look like this:

Animation Manager

Add the movement

  1. Select the base (Object 0).

  2. In the Timeline, click the Animate button.

  3. Move the Timeline Slider to tick 99.

  4. In the Timeline, Switch to rotation mode.

  5. Click the Y-Axis button and enter 360 in the edit box.

    Animate

Scrub the Timeline Slider or click the Play button to see that all the objects rotate.

Play

Set up IK Constraints

We would like the top to stay in place and that only the base would be rotating. By turning objects into joints gives Bongo permission to move the objects in order to solve the calculation.

  1. Select the the long arm (Object 1).
  2. From the Properties tab, choose Bongo > Part of an IK chain > Joint. For type choose Hinge, and Rotation Y, since we want the object to only rotate in the direction of the Y-axis.
    IK setup
  3. Select the point (Point 2).
    Object select
  4. From the Properties tab, choose Bongo > Part of an IK chain > Constraint. Press the Select Object -button, to constrain the point to an object.
    Object select
  5. Select the line called Object 3. See image.

Object select

Scrub the Timeline Slider or click the Play button to see what the animation now looks like.

Get the top to look in the right direction

Use the Look At constraint to get an object to face in the direction you want to.

  1. Select the Top (Object 2).
  2. From the Properties tab, choose Bongo > Simple Constraint.
    Object select
  3. Add a Look At constraint, when prompt Pick New Heading Vector, select the point at the end of the line by having Osnap to Point on, see image below. The constraint heading determines the direction the object will use to face an object to which it is constrained.
    Object select
  4. When prompt Select target object, select the same point at the end of the line by having Osnap to Point on, see image above.

Scrub the Timeline Slider or click the Play button to see what the animation now looks like.