5
$\begingroup$

I pretty much just want multiple camera views at the same time (like side by side), so I can get different views of the game.

Also, I can see things in one camera view that I can't in another. Imagine monitors in a security room and each monitor shows a different camera in the building... Anything like that?

(FYI: I'm on Linux, v2.76 64bit)

$\endgroup$
2
  • $\begingroup$ Maybe "active" is not the best term to use here, since in Blender there can by definition be only one active object at a time. Good question though. $\endgroup$
    – Mentalist
    Oct 11, 2015 at 1:07
  • $\begingroup$ I do not have a detailed explanation here, but I suggest to look for viewports: blender.org/api/blender_python_api_2_76_release/… $\endgroup$
    – Monster
    Oct 12, 2015 at 4:52

1 Answer 1

1
$\begingroup$

I didn't write this script but it seems to work, and I think I understand how it works. Script credit

from bge import logic, render
camList = logic.getCurrentScene().cameras

cont = logic.getCurrentController()
own = cont.owner
cam1 = camList[own['cam1']]
cam2 = camList[own['cam2']]

width = render.getWindowWidth()
height = render.getWindowHeight()

cam1.setViewport(0, 0, int(width/2), height)
cam2.setViewport(int(width/2), 0, width, height)

cam1.useViewport = True
cam2.useViewport = True

Now the object that's running this is a cube, and it's logic looks like this:

enter image description here

Notice the two string properties! These define the cameras that will be used. you can see them called in lines 6 & 7. Basically, the script designates the Viewport area of each camera to half the width of the screen, which is perfect for split screen while playing a game with a friend... Like, a really close friend, cause you'll probably have to share a chair. :)

DISCLAIMER!!!: I did not write the script included in this answer

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .