Hi folks,
a need some help with some QGL-stuff.
The background storry: I am trying to simulate a multi-camera-system with qt4 and opengl. Therefore I wrote a class GLCam derived from QGLWidget, which implements paintEvent() and does most of the GL-things (as suggested by Trolltechs tutorial http://doc.trolltech.com/4.4-snapsho...rpainting.html ).
This class holds a (simple) 3d-scene and each instance of GLCam represents a "virtual" camera looking at the scene from a different viewpoint, different technical parameters (resolution, sensor size, lens disturbance etc....). Now my application needs from each virtual camera an image. At the moment I do something like this to get the images
Qt Code:
for(int i=0; i<numberOfCameras; ++i){ virtualCamera[i].raise(); virtualCamera[i].repaint(); }To copy to clipboard, switch view to plain text mode
This sequentially pops up all the "camera images" and saves them. It works for small "virtual" camera images (low resolution) quite well, but as I increase the resolution of the virtual cameras there is just some flicker and the images remain empty. I also tried activateWindow(), updateGL(), glFlush(), glFinish() in some places in the code, but it doesn't help at all
My guess is that grabFrameBuffer() doesn't wait till the painting is done. So no image can be obtained. Is there an easy way to wait until the widget is fully displayed? Something like virtualCamera[i].ensureVisibility()? Or a flag which indicates that the widget is fully visible?
Thanx in advance
DGray
Bookmarks