Hi there;
I am a beginner. I need some help in OpenGl to achieve my graduation project at university.
I have a sequence of 3 images of the same scene, so how can I divide my image into 3 vertical strips and then take the first strip of the first image, the second strip of the second image, and the third strip of the third image and then add them together in one new image so that the first strip is at the left, the second in the middle and the third on the right of the new image and display the resulting image?
I used: glReadBuffer(GL_BACK), glReadPixels, glDrawBuffer,glCopyPixels, and other functtions but in vain. any ideas?
int main(int argc, char** argv) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(1020, 768);
glutCreateWindow("Selina Rio - UCL London");
initRendering();
glutKeyboardFunc(handleKeypress);
glutReshapeFunc(handleResize);
if (counter == 1)
{
glReadBuffer(GL_BACK);
glReadPixels(0,0,340,768,GLUT_RGB,GLUT_DOUBLE,data);
}
if (counter == 2)
{
glReadBuffer(GL_BACK);
glReadPixels(341,0,340,768,GLUT_RGB,GLUT_DOUBLE,data);
}
if (counter == 3)
{
glReadBuffer(GL_BACK);
glReadPixels(680,0,340,768,GLUT_RGB,GLUT_DOUBLE,data);
}
…
…
glutMainLoop();
return 0;
}