WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Avatar (https://forum.worldviz.com/showthread.php?t=1927)

Moh200jo 03-23-2009 01:29 AM

Avatar
 
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

Code:

pos = avatar.getPosition()

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



All times are GMT -7. The time now is 04:39 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC