Vizard 7 » Tutorials & Examples » Avatars » Animating avatars » Tutorial: Animating avatars
7.7

Tutorial: Animating avatars

This tutorial will teach you how to add walking actions to an avatar. In this example the user will be able to click anywhere on the ground and the avatar will walk to that point.

This content is discussed in more detail in the reference section.

Start the script

If you have trouble getting the code in this tutorial to work, you can find the complete example script animatingAvatars.py in the \tutorials\avatars directory.

 

Enter the following lines into your script:

import viz
import vizact

viz.setMultiSample(4)
viz.fov(60)
viz.go()

ground = viz.addChild('ground.osgb')
avatar = viz.addAvatar('vcc_male.cfg')

viz.MainView.move([0,10,-20])
viz.lookAt([0,0,0])

viz.mouse(viz.OFF)

This code adds the ground and avatar model to the world. It also places the camera far away from the ground so we have a good view of it and disables mouse navigation.

For additional examples, check out:

avatar

Adding an avatar

Animating an avatar

Using built-in animations

Using multiple animations

Animating avatar interactions

Smooth moves