• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# A curious problem

## Recommended Posts

I am trying to create a program that generates panoramic images using OpenGL under Linux. I am using a technique that involves taking 8 images 45 degrees apart with a 45 degree frustrum, then pasting the images together to give a 360 degree image. There is some matrix transformation stuff after that to correct for distortion but that isn't important right now. The problem I am having is that when I take the images they always seem to get rendered out of order. This is the code that takes the 8 images:
  for (i = 0; i < 8; i++) // Take 8 pictures { cout << "Taking picture at angle: " << InitialAngle + i*45 << endl; mainWidget->updateGL (); mainWidget->changeRotation (0.0, i * 45, 0.0); // Move to next angle Images[i] = mainWidget->getShot (); // Get the picture and store in array of pictures } 
UpdateGL() is the rendering function. GetShot() calls glReadPixels() to get the pixel data from the frame. What I want to know is how to force the images to be rendered in the correct order. It seems that the sampling of the frame happens at the wrong time because sometimes it captures two copies of one image and none of another. But it also doesn't render in the right order, because the frames are displayed as they are rendered and they are out of order. I've tried adding a call to glFlush() in that loop but it didn't make any difference. Can anyone help with this? -------------------- Never eat anything bigger than your own head. Edited by - Biggles on November 14, 2001 9:18:33 PM