rroemmich29
08-31-2016, 07:27 AM
Hi all,
We have created a visual flow environment where the velocity of the flow matches the velocity of a treadmill in our lab. The velocity of the treadmill changes from step to step based on the step length of the participant and the visual flow in turn updates to the same velocity.
I am having an issue where the visual flow transitions from one velocity to another appear to have some jitter and was wondering if anyone could give me some advice on how to eliminate it. Essentially, when the flow changes velocity, the screen appears to jitter back and forth very briefly (a matter of milliseconds) before settling on the new velocity.
When I run something like this, the view velocity updates very smoothly:
vel = 1.2
velcount = 1
view = viz.MainView
view.eyeheight(1.7)
def updatevel():
global vel
view.velocity([0,0,vel])
print vel
def addvel():
global vel
global velcount
if velcount == 1:
vel=vel+1
velcount = 2
else:
vel=vel-1
velcount = 1
def updatefn():
updatevel()
addvel()
vizact.ontimer(1,updatefn)
I am unsure why my code differs from this and have attached it below in case anyone has any ideas. I am happy to provide further information if anything is unclear.
Thanks in advance!
We have created a visual flow environment where the velocity of the flow matches the velocity of a treadmill in our lab. The velocity of the treadmill changes from step to step based on the step length of the participant and the visual flow in turn updates to the same velocity.
I am having an issue where the visual flow transitions from one velocity to another appear to have some jitter and was wondering if anyone could give me some advice on how to eliminate it. Essentially, when the flow changes velocity, the screen appears to jitter back and forth very briefly (a matter of milliseconds) before settling on the new velocity.
When I run something like this, the view velocity updates very smoothly:
vel = 1.2
velcount = 1
view = viz.MainView
view.eyeheight(1.7)
def updatevel():
global vel
view.velocity([0,0,vel])
print vel
def addvel():
global vel
global velcount
if velcount == 1:
vel=vel+1
velcount = 2
else:
vel=vel-1
velcount = 1
def updatefn():
updatevel()
addvel()
vizact.ontimer(1,updatefn)
I am unsure why my code differs from this and have attached it below in case anyone has any ideas. I am happy to provide further information if anything is unclear.
Thanks in advance!