Rendering on Muliple Monitors

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Atraides
Posts: 18
Joined: Wed Jun 06, 2007 1:09 am
Location: Australia

Rendering on Muliple Monitors

Post by Atraides »

Hi all,

long time reader first time poster.

I'm trying to do a project that is using a whole bunch or sensors for movement and such. Its required to have three people playing as a single tank at one time therefore im trying to work out a way that we can render 3 different camera's on to 3 different monitors, for example, 3rd person camera for the person controlling the tank, a 1st person camera for the person controlling the gun and another 1st person camera for inside the tank.

I have seen a few different tutorials on the forums about it, but haven't really been able to follow them very well.

Any help on this would be appreciated,

Cheers
Courtney
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

It might be easier to make the software network aware. Have one 'server' reads the sensors and control input. It could also display one of the views. The other views would be 'clients' that would take information provided by the 'server' to display their views, and they would feed control input back to the server.

Travis
Atraides
Posts: 18
Joined: Wed Jun 06, 2007 1:09 am
Location: Australia

Post by Atraides »

ah ok, was looking to an alternative to doing net code as i have had some problems with netcode and irrlict working properly but i guess that it would be a fair bit simplier. Thanks for your response Vitek
Kuehrli
Posts: 6
Joined: Thu May 10, 2007 8:32 am
Location: Linz, AT

Post by Kuehrli »

Depending the rendering: I've implemented something similar with 2DImages and a GUI on the first monitor and and a 3D-scene on the second monitor. There are two solutions to display this (beside vitek's networking solution):

First you make one window for each monitor and render to each one seperately. Have a look at the last posts in this thread: http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=20887

Second you span one big window over the three monitors and every frame you do this for each monitor: setViewport - setActiveCamera - drawAll.
For 2 monitors with a resolution of 1280x1024:

Code: Select all

ICameraSceneNode* camera = smgr->addCameraSceneNode(0, vector3df(0,10,-7), vector3df(0,0,-2));
f32 aspect = 1280.0f / 1024.0f;
camera->setAspectRatio(aspect);

ICameraSceneNode* camera2 = smgr->addCameraSceneNodeFPS(0, 100, 20);
camera2->setPosition(vector3df(0,10,-7));
camera2->setTarget(vector3df(0,0,-2));
camera2->setAspectRatio(aspect);

while(device->run())
{
	driver->beginScene(true, true, SColor(255,0,0,0));
	driver->setViewPort(rect<s32>(1280,0,2560,1024));
	smgr->setActiveCamera(camera);
	smgr->drawAll();

	driver->setViewPort(rect<s32>(0,0,1280,1024));
	smgr->setActiveCamera(camera2);
	smgr->drawAll();
	driver->endScene();
}
But getting the right user input for each viewport should be a bit more difficult (if you want to control the cameras)...
Atraides
Posts: 18
Joined: Wed Jun 06, 2007 1:09 am
Location: Australia

Post by Atraides »

@Kuehrli

Cool thanks mate for the reply, ill have a go at it and see if i can get it to work the way i needed it too.
Post Reply