PDA

View Full Version : Avatar


Moh200jo
03-23-2009, 01:29 AM
My application requires the avatar to walk for unknown distance and direction; mouse or keyboard should control the direction. How vizard do that?
Any suggestion would be really appreciated.
Thanks,

Jeff
03-24-2009, 09:06 AM
Within your keyboard callback function get the avatar's position and, for example if viz.KEY_UP is pressed, create a walkTo action where the z value is incremented. Something like this

pos = avatar.getPosition()

if key == viz.KEY_UP:
walk_Forward = vizact.walkTo([pos[0], pos[1], pos[2] + 3])
avatar.addAction(walk_Forward)