I have a program in which I can render a scene on the screen in accordance with the position of the user. When the user changes position, the truncation changes to give off-axis projection. I want to use the technique to work on three different screens stitching together a large scene with something like the following:
Imagine a big real world scene appeared on three screens. Three screens should show the scene how it will look with a changed perspective on each display in accordance with the user's position. I can do this with a single display to render the scene according to the user's position, but I can't think about how this method works on three screens.
The off-axis projection of the class that I created basically does the following:
customCam::project(){ pushMatrices(); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glFrustum(leftNear.x, rightNear.x, bottomNear.y, topNear.y, _near, _far); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(uPos.x, uPos.y, 0, uPos.x, uPos.y, -1, 0, 1, 0);
How to subside three truncations in such a way that the scene looks continuous, as in the real world? Currently, the class user draws the scene as follows:
cstCam.project(); //draw something here popMatriceS(); //which were pushed before glFrustum projection
EDIT: In my case, to define three truncations for the user (taking into account the user and screen angles for all displays in the same coordinate system), I did the following:
custCam1.project(); //draw scene here. eg: two walls at the far left and right screen drawWalls(); popMatrices(); custCam2.project(); drawWalls(); popMatrices(); custCam3.project(); drawWalls(); popMatrices(); void drawWalls(){ //Left most corner screen wall glBegin(GL_QUADS); glVertex3f(-1.5*PHWIDTH, HEIGHT/2, 0); //where PHWIDTH, HEIGHT is the physical width/height of each screen glVertex3f(-1.5*PHWIDTH, HEIGHT/2, -50); glVertex3f(-1.5*PHWIDTH, -HEIGHT/2, -50); glVertex3f(-1.5*PHWIDTH, -HEIGHT/2, 0); glEnd(); //Right most corner screen wall glBegin(GL_QUADS); glVertex3f(1.5*PHWIDTH, HEIGHT/2, 0); //where PHWIDTH, HEIGHT is the physical width/height of each screen glVertex3f(1.5*PHWIDTH, HEIGHT/2, -50); glVertex3f(1.5*PHWIDTH, -HEIGHT/2, -50); glVertex3f(1.5*PHWIDTH, -HEIGHT/2, 0); glEnd(); }