#1
|
|||
|
|||
Temporal delay on movement
I was wondering if there was a way to delay the input sent for movement. I'm using vizcam.addWalkNavigate() to control my movement currently, and I was wondering if there was a way to have my movement be slightly delayed from my actual input, so that I can, for example, press the key to move forward and then a second or two later, the movement would actually occur.
Thanks in advance! |
#2
|
|||
|
|||
You could try something like the following:
Code:
import viz import vizact import vizcam viz.go() DELAY = 2 dojo = viz.add('dojo.osgb') walkNav = vizcam.addWalkNavigate() recordedData = [] def RecordTrackingData(): recordedData.append( (walkNav.getPosition(), walkNav.getQuat()) ) vizact.onupdate(0,RecordTrackingData) def ApplyTrackingData(): pos,ori = recordedData.pop(0) viz.MainView.setPosition([pos[0],1.8,pos[2]]) viz.MainView.setQuat(ori) ApplyDataCallback = vizact.onupdate(0,ApplyTrackingData) ApplyDataCallback.setEnabled(viz.OFF) vizact.ontimer2(DELAY,0,ApplyDataCallback.setEnabled,viz.ON) |
#3
|
|||
|
|||
Fantastic! That worked for using addWalkNavigate, but I'm now using VRPN 7 to get location data, as such:
Quote:
|
#4
|
|||
|
|||
Are you getting any errors? Can you post the code you tested with?
|
#5
|
|||
|
|||
No errors, but here's the code I'm working with:
Quote:
|
#6
|
|||
|
|||
The manual setting of the viewpoint in your script is overridden by the viewpoint link defined in the viztracker file. For this custom viewpoint movement its probably best to configure the trackers in this script and not use viztracker.
|
Thread Tools | |
Display Modes | Rate This Thread |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
3ds Exported .IVE Model mirrors movement of Mainview | Felix | Vizard | 9 | 05-18-2012 09:17 AM |
Jerking Movement | ssaha | Vizard | 0 | 04-08-2010 11:41 AM |
Reading bone movement from animations | Enlil | Vizard | 5 | 08-14-2008 02:29 PM |
Mouse/Keyboard Movement | joeymax | Vizard | 1 | 04-02-2007 10:43 AM |
movement problems | keastman | Precision Position Tracker (PPT) | 1 | 09-09-2003 11:41 AM |