3 monitor and camera position :-/

This topic is 4964 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

AHOY! I have a BIG problem, I'm tring to develop a 3D game with 3 monitors, the monitor position is / --- \, / is one monitor, --- is the front monitor and \ is the right monitor. Ok, in my game I need to create a mirrored screen like this, \ --- /. Now the big problem, how can I calculate the camera position for each monitor??? Thanks Alexandre Ribeiro de Sá

Share on other sites
hmmm i think camera positions must be the same, only orientations must differ(because of way how projection works). Also you need to set field of view of monotor's camera to be equal to angle you see monitor with(it's quite important).
That is, if monitor have horisontal size N cm , and eye is at M cm from screen, your horisontal field of view must be 2*atan(0.5*N/M) radians.

Share on other sites
AHOY AGAIN!

What I made it get the point in the circle to set the camera possition, but, I have some problem... :-/

			glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );			glLoadIdentity();			// Camera 1			float x = float(45 * cos(deg2rad(-57.839935f+rotate)));			float z = float(45 * sin(deg2rad(-57.839935f+rotate)));			Camera1.eye.x = moveX;			Camera1.eye.z = moveZ;			Camera1.center.y = moveY;			Camera1.center.x	= x + moveX;			Camera1.center.z	= z + moveZ;			glViewport(0, 0, 320, 240);			V_Graphic.v_SetPerspective( 45.0f,(GLfloat)320/(GLfloat)240, 1, 10000.0f );			V_Graphic.v_SetCamera(Camera1);			//glRotatef( rotate, 0, 1, 0 );				Draw3DSGrid();				DrawSpiralTowers();			//glRotatef( rotate, 0, -1, 0 );			// Camera 2			x = float(45 * cos(deg2rad(0+rotate)));			z = float(45 * sin(deg2rad(0+rotate)));			Camera1.center.x	= x + moveX;			Camera1.center.z	= z + moveZ;			glViewport(320, 0, 320, 240);			V_Graphic.v_SetPerspective( 45.0f,(GLfloat)320/(GLfloat)240, 1, 10000.0f );			V_Graphic.v_SetCamera(Camera1);			//glRotatef( rotate, 0, 1, 0 );			Draw3DSGrid();			DrawSpiralTowers();			//glRotatef( rotate, 0, -1, 0 );			// Camera 3			x = float(45 * cos(deg2rad(57.839935f+rotate)));			z = float(45 * sin(deg2rad(57.839935f+rotate)));			Camera1.center.x	= x + moveX;			Camera1.center.z	= z + moveZ;			glViewport(640, 0, 320, 240);			V_Graphic.v_SetPerspective( 45.0f,(GLfloat)320/(GLfloat)240, 1, 10000.0f );			V_Graphic.v_SetCamera(Camera1);			//glRotatef( rotate, 0, 1, 0 );				Draw3DSGrid();				DrawSpiralTowers();			//glRotatef( rotate, 0, -1, 0 );

here a picture: http://www.vortexentertainment.com/3monitor.jpg
in the first window, the render is correct, the elevation from each camera is equal, but if I try to "look up", there many render errors...

Thanks
Alexandre Ribeiro de Sá

[Edited by - alex_r on October 23, 2004 2:14:53 PM]

Share on other sites
AHOY!

Is it what I like to do:
http://www.coinopexpress.com/img_machines/img_2_678.jpg

Share on other sites
Looking at the images, do you want the result to be as if it were a single image, i.e. so when you stitch them together there are no continuities and all things match up smoothly ?

If so that's not possible to achieve with the usual cameras available to you in an API such as OpenGL. The problem is the standard perspective camera works like a standard film/digital camera. You can't just stick them next to each other and get a smooth image, you need to use special software. The calculations done by such software are probably too expensive to do in realtime, or at least without hardware & API support.

What you could do is not use three perspective cameras. Instead use a perspective camera in the middle and the equivalent of view cameras on either side, with their geometry based on the geometry i.e. the FOV of the central camera. You would need to roll your own matrices as GL doesn't know about view cameras.

Unfortunately my knowledge of this comes from photography not games, so I have not worked out any details of this. The calulations should be similar to the standard perspective camera calculations modified to acomodate the view plane transformation. A quick googe turned up this and this.

• 10
• 17
• 9
• 13
• 41