![]() |
|
#1
|
|||
|
|||
I'll have to ask a developer if there is a way to get the refresh rate from a connected HMD. You could check to see if the HMD is connected and hardcode the rate based on that.
The following shows how to create create an action from a node3d command: Code:
import viz import vizact viz.go() viz.MainView.getHeadLight().disable() viz.clearcolor(viz.SLATE) ball = viz.addChild('basketball.osgb',pos=[0,1.8,3]) light = viz.addLight() light.intensity(0) mix = vizact.mix(0.0, 1.0, time=1.0) change_intensity = vizact.method.intensity(mix) light.addAction(change_intensity) |
#2
|
|||
|
|||
Thanks for the info regrading actions, that would be the second way I outlined above. Good enough for now. As I pointed out earlier, hard coding would not be preferable. I do think, though, that the option for getting the current refresh rate would be great for a graphics/3D engine.
Btw., is there a Vizard command to get the current system time? Or do you have to rely on python's 'time' library? From using the PsychToolbox I am used to have a command that waits for a particular system. There you can get a time stamp from basically every time critical command and then wait for this time stamp plus 10 ms, e.g. But then the minimum time interval you can wait in the Vizard is bound to the refresh rate, correct? Unless you are using the director function, of course (which spawns another thread, iirc). |
#3
|
|||
|
|||
Quote:
Quote:
|
#4
|
|||
|
|||
Thanks, viz.tick would suffice for this purpose.
If I was under time pressure I could have just coded this from scratch: change the light intensity by 1% and wait for 10 ms. Rinse, repeat. I would just ignore the fact that these slight changes do not coincide with frame buffer swaps. Like this I wouldn't have had to know the framerate. Ideally, I would wait for 'lastTimeStamp + 10 ms' in order to be precise, which would basically be possible with the viz.tick command. But only using the 'viz.director', of course. Sometimes it is faster to code yourself than to find out whether designated methods exist and how they work. |
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Question about Vizard Expiration Timer Rate | mizutani_jun | Vizard | 2 | 02-23-2011 09:13 PM |
Vizard 4 Beta Testing | farshizzo | Announcements | 0 | 02-01-2011 10:46 AM |
Vizard 4 Beta Testing | farshizzo | Vizard | 0 | 02-01-2011 10:46 AM |
Vizard tech tip: Using the Python Imaging Library (PIL) | Jeff | Vizard | 0 | 03-23-2009 11:13 AM |
Vizard tech tip: Text to Speech | Jeff | Vizard | 1 | 01-15-2009 09:39 PM |