For this section we'll add some human avatars in conversation and a flock of pigeons. Avatars are a special subset of 3D models that can change their shape with animations. The avatar functionality in Vizard is very extensive so in this example we're going to stick with the basics. First, we'll add two sample avatars that are included with Vizard. To load an avatar file use the viz.addAvatar command. Run the following script showing two avatars to the right of the fountain:
It only takes one line of code to apply a built-in animation to an avatar. Add the following code to set the avatars' talking states:
Vizard also includes a pigeon avatar. With a for loop we'll create a flock of birds at random positions in front of the fountain. Python's random module has a number of commands that are useful for selecting random values. Here we'll use random.randint to choose the positions. Add the following code to the end of your script and then run it: