Vizard 7 » Tutorials & Examples » Flow control » Actions » Tutorial: Action objects
7.6

Tutorial: Action objects

This tutorial will teach you how to perform a sequence of built-in animations on an object.  In this example we will add a model of a wheelbarrow and make it move along a square path.

Note: this content is discussed in more detail in the Action basics reference section.

Starting an action object

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

 

Enter the following lines into your script:

import viz
import vizact

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

viz.addChild('ground.osgb')
wheel = viz.addChild('wheelbarrow.ive')
viz.MainView.move([0,0,-7])
viz.clearcolor(viz.SKYBLUE)

This initializes Vizard, adds some models, moves the viewpoint back 7 meters, and sets the background color to sky blue. The first thing we need to do is create the actions for the wheel barrow. We will be using the vizact library. This library contains many built-in animations that you can apply to most 3d objects.

Action objects

Building an action

Applying an action