Home | Tutorials | Articles | Categories | Channel list | SDK | Exporting | F.A.Q.

WARNING: This is archived content.

This page contains information about Quest3D 4 and earlier versions. If you want documentation about Quest3D 5.0 or higher go to http://documentation.quest3d.com

Chapter 2.11: Character animation

From Quest3D

Jump to: navigation, search

Contents

2.11 Character animation

Chapter 2.2 explained basic 3D Object animation. In this chapter, an advanced form will be discussed: character animation.

Humans and animals don’t simply slide when they move. Instead they use various parts of their body independently of each other. But rather than a collection of seperate limbs, these are all moving in relation to one another. When one of the limbs is moved, the skin stetches along with it.

Virtual skeletons

3D models can be set up to behave in a similar manner. The polygon surface of the model can be seen as the skin. A virtual skeleton can be used to animate various parts of this skin seperately. Practically speaking, each of the vertices of a 3D model must be linked to the appropriate bones of a virtual skeleton.

Image:Example137.jpg

Advanced modeling software packages such as 3D Studio Max ship with pre-made virtual skeletons. These can be linked directly to your own character, or adjusted and expanded if needed. Please refer to the manual of your favorite modeling program to learn more about working with virtual skeletons. Keywords: ‘bone’, ‘animation’, ‘biped’.

Character animation in Quest3D

Virtual skeleton animation data can be imported into Quest3D. A 3D model with bone animation will result in a nearly standard 3D Object channel structure. However, two channels are added.

Image:Example138a.jpg

The Skinned Character channel is placed between the Surface and the 3D Object Data channel. It contains the definition of the virtual skeleton, and information on how the 3D model is connected to the virtual skeleton.

The Motionset channel contains all bone animation data in the form of keyframes for position, rotation and scale. The animation can be played by linking a value to the first child link of the Motionset (for example, a TimerValue).

Switching Motionsets

Characters in a scene are likely to have more than one animation. At any given point in time, they may stand still, walk, run or use an object for example. One approach to alter between animations is to use a Channel Switch. Based on an index value, one of the Motionsets is selected.

Image:Example139b.jpg

Motionset Blender

The solution above results in harsh transitions. To make animations transition more smoothly, the Motionset Blender can be used. This channel accepts two Motionsets and one Value. This value defines how much of the two sets is displayed. A value of 0 means only the first Motionset is used, while a value of 1 means only the second is used. A value between 0 and 1 effectively blends both sets through linear interpolation.

Image:Example140a.jpg

The image below shows 100% walk, 50% walk and sit, and 100% sitting respectively.

Image:Example141.jpg

The blend value of a Motionset Blender can be derived from any kind of information used elsewhere in a Quest3D program. Envelope channels can be used to convert any value to the required range of 0 to 1. Example blend values include User Input and object speed.

Image:Example142.jpg Image:Example142v.jpg

Value Damping

A compact and inexpensive way to animate the transition from 0 to 1 and vice versa is by using a Value Damping channel.

Image:Example143.jpg

Tutorial

The following exercise explains importing character animation into Quest3D. It also describes motionset blending.

Needed .X files:

  • ..\Resources\Characters\Animated character – Idle.X
  • ..\Resources\Characters\Animated character – Walk.X

Needed templates:

  • Scene \ Start 3D Scene
  • Scene \ Simple Scene
  • Animation \ TimerValue
  • Animation \ Deformations \ Motionset Blender
  • Variables \ Value \ Value Damping
  • Logic \ User Input \ User Input

Step by step:

  • From the File Menu, choose ‘Import’.
  • Locate the file ‘..\Resources\Characters\Animated character – Idle.X’ and press ‘Open’.
  • Use ‘Character animation 1’ as Pool name, and press ‘OK’ to confirm.
  • In the ‘X Object Importer Options’ window, choose ‘Load as indexed character’, and press ‘OK’ to accept. The 3D character model is imported into Quest3D.

Image:Example144a.jpg

  • Rename the channel of type 3D Object to ‘Animated Character’.
  • Drag a Simple Scene channel into the Channel Graph.
  • Delete the 3D Text Object
  • Set the Start 3D Scene as start channel.
  • Connect the ‘Animated Character’ channel to the ‘Render’. Note it is displayed in the Animation 3D View window.
  • Rename the ‘Motionset’ channel to ‘Idle Motionset’.
  • Drag a Timer Value onto the Channel Graph and attach it to the ‘Idle Motionset’ channel. Double click on the ‘Timer Value’ channel, select ‘New..’ from the drop-down list, and type in ‘Animated Character Idle’ in the edit box. Press ‘OK’ to accept, and close the properties window.
  • Go to the Animation Section.
  • Make sure the Animation 3D View displays the scene using the Project Camera.
  • Choose ‘Animated Character Idle’ from the timer drop-down list. Set the end frame to ‘450’ and press the Play button . Note the character starts animating.

Image:Example145.jpg

  • Go to the Channels Section.
  • Delete the link between the ‘Idle Motionset’ and ‘Skinned Character’ channels.
  • Add a Motionset Blender and connect it to the ‘Skinned Character’ channel.
  • Connect the ‘Idle Motionset’ to the Motionset Blender.
  • Import the file, ‘Walk.X’ using the same procedure as above.
  • Locate the ‘Motionset’ channel of the newly imported group, and copy it.
  • Switch to the main channel group.
  • Paste the Motionset onto the Channel Graph.
  • Rename this Motionset to ‘Walk Motionset’ and connect it to the second child link of the ‘Motionset Blender’ channel.
  • Drag another Timer Value channel onto the Channel Graph and connect it to the ‘Walk Motionset’ channel.
  • Set this Timer Value to a new timer called ‘Animated Character Walk’
  • Drag a Value Damping onto the Channel Graph and connect it to the third child link of the ‘Motionset Blender’ channel.
  • Add a User Input channel and connect it to the ‘Value Damping’ channel. Set the User Input channel to the Arrow Up key.

Image:Example145a.jpg

  • Go to the Animation Section.
  • Choose ‘Animated Character Walk’ from the timer drop-down list. Set the end frame to ‘27’ and press the Play button.
  • Switch to Run Mode.
  • Test the scene so far by pressing the arrow up key. Note how the Value Damping increases from ‘0’ to ‘1.0’ over time. Note how the 3D character animation blends from idle to walk.
  • Release the arrow up key. Note how the Value Damping decreases from 1 to 0 over time. Note how the 3D character animation blends from walk to idle.
  • Switch to Edit Mode.

Finished scene:

  • ..\Tutorials\2.11 – Character animation\Character animation 1 – Complete.cgr

If you wish, you can save the current channel group to your project directory. The following steps deal with a new scene.


Needed Quest3D scene:

  • ..\Tutorials\2.11 – Character animation\Character animation 2.cgr

Needed .X files:

  • ..\Resources\Characters\Animated character – Idle.X
  • ..\Resources\Characters\Animated character – Walk.X
  • ..\Resources\Characters\Animated character – Run.X

Needed templates:

· Variables \ Value \ Value Damping · Variables \ Value \ Envelope (x2)

Step by step:

  • Open the file, ‘Character animation 2.cgr’. It contains a simple scene, a character with multiple animations, and a 3rd person camera.
  • Go to the Animation Section.
  • Make sure the Animation 3D View displays the scene using the Project Camera
  • Switch to Run Mode.
  • By using the arrow keys and the mouse, move the character through the scene. Note the camera stays behind the character. Note the character doesn’t animate properly yet and only displays its idle sequence.
  • Switch to Edit Mode.
  • Go to the Channels Section.
  • Add an Envelope channel and connect it to the ‘Value Damping’ channel.
  • Make a shortcut of the ‘Character Speed’ channel (part of the Collision Response system) and connect it to the Envelope.
  • Double click on the Envelope. Add a point at (0, 0). This point means that when the character speed (input) is 0, the Motionset Blender will fully use the ‘Idle’ animation.
  • Add a point at (0.02,1), meaning that when the character speed is 0.02, the Motionset Blender will fully use the ‘Walk’ animation. A speed between 0 and 0.02 will result in a blend of 0 to 1 between the ‘Idle’ and ‘Walk’ animations.
  • Switch to Run Mode.
  • Test the scene so far by pressing the arrow up key. Note the ‘Character Speed’ channel changes in value. Note the character animation blends from ‘Idle’ to ‘Walk’.
  • Release the arrow up key. Note how the ‘Character Speed’ channel changes in value. Note the character animation blends from ‘Walk’ to ‘Idle’.
  • Switch to Edit Mode.
  • Add another Envelope and link it to the Value Damping channel connected to the Motionset Blender binding the ‘Walk’ and ‘Run’ channels.
  • Make another shortcut of the ‘Character Speed’ channel and connect it to this new Envelope.
  • Double click on the Envelope. Add points at (0.25, 0) and (0.5, 1).
  • Go to the Animation Section.
  • Switch to Run Mode.
  • Test the scene by pressing the arrow up key. Note the character starts walking.
  • Press and hold both the arrow up key and the shift key. Note the speed is increased and the character starts running.

Image:Example145d.jpg

Finished scene:

  • ..\Tutorials\2.11 – Character animation\Character animation 2 – Complete.cgr

Back to Main Index

Personal tools
Navigation