Vizard 7 » Tutorials & Examples » Example scripts » Avatars » Motions
7.7

Motions

\examples\avatar\motions.py

This script demonstrates how to change the state of an avatar.

import viz
import vizact

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

#Add the environment
dojo = viz.addChild('dojo.osgb')

#Add an avatar
avatar = viz.addAvatar('vcc_male.cfg', pos=(-2,0,0), euler=(90,0,0) )

#Move the viewpoint
viz.MainView.setPosition([2,1.8,0])
viz.MainView.setEuler([-90,0,0])

vizact.onkeydown('1', avatar.state, 1)
vizact.onkeydown('2', avatar.state, 2)
vizact.onkeydown('3', avatar.state, 3)
vizact.onkeydown('4', avatar.state, 4)
vizact.onkeydown('5', avatar.state, 5)
vizact.onkeydown('6', avatar.state, 6)
vizact.onkeydown('7', avatar.state, 7)
vizact.onkeydown('8', avatar.state, 8)
vizact.onkeydown('9', avatar.state, 9)
vizact.onkeydown('0', avatar.state, 10)
vizact.onkeydown('a', avatar.state, 11)
vizact.onkeydown('b', avatar.state, 12)
vizact.onkeydown('c', avatar.state, 13)
vizact.onkeydown('d', avatar.state, 14)
vizact.onkeydown('e', avatar.state, 15)