Split screen
by Luis Anton · in Torque Game Engine · 07/22/2004 (8:58 am) · 5 replies
Hi!
I need to create some split screen effect, a vertical one. However, what I really need is to follow these steps:
1) draw the scene, in a 'normal' resolution, say 800x600
2) resize the frame to it's half height: 800x300 and put it at 0,0
3) draw the scene again, from a different point of view, at the same resolution (800x600)
4) resize the new frame to it's half height: 800x300 and put it at 0,300.
5) show the whole thing
Get the idea? We are trying stereo using vertical frame, so I need to do those changes in resolution to conserve vertical proportions. I was using two GuiViewport, one at (0,0) and another at (0,300), but it's not the same effect. GuiViewport draws according to it's own FOV, and it won't change proportions.
Is there something like glResizeFrameAndPutItHere after gClientSceneGraph->renderScene()? :)
See you
I need to create some split screen effect, a vertical one. However, what I really need is to follow these steps:
1) draw the scene, in a 'normal' resolution, say 800x600
2) resize the frame to it's half height: 800x300 and put it at 0,0
3) draw the scene again, from a different point of view, at the same resolution (800x600)
4) resize the new frame to it's half height: 800x300 and put it at 0,300.
5) show the whole thing
Get the idea? We are trying stereo using vertical frame, so I need to do those changes in resolution to conserve vertical proportions. I was using two GuiViewport, one at (0,0) and another at (0,300), but it's not the same effect. GuiViewport draws according to it's own FOV, and it won't change proportions.
Is there something like glResizeFrameAndPutItHere after gClientSceneGraph->renderScene()? :)
See you
#2
10/20/2004 (9:59 am)
How would this technique apply to three or four player split screens? I'm afraid I'm not familiar enough with the API to understand exactly what you're doing let alone extend it to more then two views...
#4
07/09/2006 (3:04 am)
How do you add a new GUI viewport?
#5
09/19/2006 (9:39 pm)
Yeah I wana know that two,is it mean that 2 player can play using the same pc,you know like the old car racing games
Torque Owner Luis Anton
First, set up two GuiViewport, as I said before, one over the other.
Then, using gluPerspective, in SceneGraph::renderScene, does the trick:
Well, values are hardcoded (50 is the FOV, 1.333333 the aspect: 800/600), but the code added after dglGetViewport simulates gluPerspective. Those new values will be used afterwards, in a glFrustum call.
Hope it helps... if someone needs this or something similar someday :)