From: Jonathan B. <jbr...@ea...> - 2006-10-12 01:56:44
|
On Wed, 2006-10-11 at 11:00 +0200, Goedele Van Belle wrote: > Hi, > > I am a researcher in visual perception, more precisely we are > investigating transsaccadic change blindness. This means we change the > position of an object in a 3D scene, during an eye movement. Afterwards > the viewer has to indicate whether or not he notices something was > replaced. Therefor it is very important this position change occurs > during the eye movement, and not after it. > > We are using VPython to display the scene, because it is so nice to use. > But there is a slight problem with it. An eye movement takes about 30 > msec, and detecting it takes about 12msec. This means there is only > about 18msec left to change the display. The problem with Visual is that > the display is only refreshed 20 times per second, which means there can > be 50msec between the command of changing the position, and the update > of the cache. > Is there a way to change this 20 times per second? (where can I find > it?) Would it still work if I update the video memory myself, every time > I change something in the scene, or, when I update the video memory > every msec? And where is the command for updating the video memory given? The time delay is hard-coded in VPython. However, you can change it in the C++ source code and make a custom build. In VPython 3.x on all platforms, see GLDevice::render_control(). The last line of this function reads "return 33;" That is the approximate number of milliseconds between renderings of the scene, which you can reduce to whatever value you like. In VPython 4 see src/win32/winrender_surface.cpp render_surface::on_showwindow(). The third argument to SetTimer() is the timeout in milliseconds (currently 30). On Linux or OSX the process is somewhat complicated by an attempt at intelligent timer management (see src/gtk2/render_surface.cpp: render_surface::forward_render_scene() and render_surface::on_realize()). If that is your platform of choice, then I'll explain what you have to do there. However, be forewarned that getting accurate and repeatable timing of this function on Windows, Linux, or a Mac is going to be very difficult. None of these operating systems provide hard realtime guarantees with regards to process scheduling. You will probably need to observe both the screen update and the eye movement and be prepared to throw out some samples. Good luck, -Jonathan |