WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   how to record data at fixed rate with viz.starttimer (https://forum.worldviz.com/showthread.php?t=5541)

hzhao 11-04-2015 02:09 AM

how to record data at fixed rate with viz.starttimer
 
HI,

I use viz.starttimer(0,1/30,viz.FOREVER) to run my object animation and record the motion data in function myAnimation. But the data is not recorded at 30Hz. instead it is recorded at about 40Hz and fluctuates.

viz.callback(viz.TIMER_EVENT,myAnimation)

viz.starttimer(0,1/30,viz.FOREVER)

I use Oculus DK2. If my virtual scene is complex and the computing burden is high, the data recording rate drops. So I set it at 1/30, and want to have a fixed recording rate. But it doesn't work.

Thanks.

mape2k 11-04-2015 06:55 AM

The script updates every frame: if the framerate drops below 30fps, the recording rate will also suffer.

You can decouple this by using the viz.director to start the data recording in a whole new thread, but it will be time asynchronous from the main thread so be careful.

Cheers!


All times are GMT -7. The time now is 01:17 AM.

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