WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Bouncing point of view during walking (https://forum.worldviz.com/showthread.php?t=4851)

seal 10-16-2013 09:15 AM

Bouncing point of view during walking
 
Dear all,

I am working on a project in which the point of view of a walking person will be simulated. So I need to add fluctuation of natural walking to the main view when the subject is moving.

I was thinking about linking the main view to an moving avatar with his body bouncing during walking. Would that be possible? Or is there a better way to achieve this?

I am quite new to Vizard. Any help and suggestion would be highly appreciated.

Many thanks!

Jeff 10-17-2013 02:27 PM

Yes, you can link the viewpoint to the head bone of the walking avatar:
Code:

'''
Toggle avatar with spacebar
'''
import viz
import vizact
import vizinfo
viz.go()

vizinfo.InfoPanel()

ground = viz.addChild('ground.osgb')
avatar = viz.addAvatar('vcc_male2.cfg',pos=[0,0,2],euler=[180,0,0])
avatar.runAction(vizact.walkTo([0,0,15]))

head = avatar.getBone('Bip01 Head')
link = viz.link(head,viz.MainView)
link.preTrans([0,0.2,-0.7])
#Set viewpoint pitch to 0
link.setEuler([None,0,None])

vizact.onkeydown(' ',avatar.visible,viz.TOGGLE)

If you want the viewpoint to bounce more try commenting out the line:
Code:

link.setEuler([None,0,None])

seal 10-21-2013 08:02 AM

It works. Thank you very much!


All times are GMT -7. The time now is 03:53 AM.

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