PDA

View Full Version : Multi-camera



JnZ
08-22-2001, 08:54 PM
Is there a EZ solution for multiple cameras is in scene..I mean that i want a split-screen like so:

_____
|1|2|
|-|-|
|3|4|
-----

So theres going to be for different views of the world http://www.opengl.org/discussion_boards/ubb/confused.gif

ffish
08-22-2001, 09:20 PM
glViewport/glScissor

Aster
08-25-2001, 08:57 PM
As ffish mentioned, you can use multiple glViewport calls in your drawing routine:

glViewport(viewX, viewY, viewWidth, viewHeight);
glMatrixMode(GL_PROJECTION);
// set up projection you want to use for a view
glMatrixMode(GL_MODELVIEW);
// draw 1st view

// repeat steps above with different (or same, if you wish) projections changing your viewX and viewY every time

Hope this helps

DaViper
08-27-2001, 02:57 AM
Originally posted by Aster:

glViewport(viewX, viewY, viewWidth, viewHeight);
glMatrixMode(GL_PROJECTION);
// set up projection you want to use for a view
glMatrixMode(GL_MODELVIEW);
// draw 1st view

// repeat steps above with different (or same, if you wish) projections changing your viewX and viewY every time

this will work as long as you don't call a gl Clear. I would stick to glScissor.

Chris