side/rear mirrors

Hi folks,

I’m on a project where you have to drive a car through a city.
I’ve now 4 cameras (one front, one rearmirror, one right mirror and one left mirror).
I’ve set them up properly like rear mirror at the top of the screen, side mirrors at the left / right side.

My problem is that the main camera (front) is on top of all the oter cameras. How can I change the priority? I read that the last enabled cam is rendered on top. But thats not working here. Please help me.

Here is the code I’m using:


#####   Viewport.py

#viewport needs to know game window height and width
import Rasterizer

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

#############

# get the current scene
scene = GameLogic.getCurrentScene()

# get list of objects in scene
objList = scene.getObjectList()

# use Camera (the active camera) for Main View
Front = objList["OBCamera"]

# use Camera.001 for Rearmirror
Rear = objList["OBCamera.001"]

# use Camera.002 for left Rearmirror
Left = objList["OBCamera.002"]

# use Camera.003 for right Rearmirror
Right = objList["OBCamera.003"]

# zoom out by changing camera lens
#Front.lens = 20.0
#Rear.lens = 10.0

################ Use the top half of the game window for Rear.

#Rear viewport: top half
leftRear = width / 4
bottomRear = height / 1.2
rightRear = width / 1.33
topRear = height

# set Rear viewport
Rear.setViewport( leftRear, bottomRear, rightRear, topRear)

################ Use the bottom half for Front.

#Front viewport: bottom half
leftFront = 0
bottomFront = 0
rightFront = width
topFront = height

# set Front viewport
Front.setViewport( leftFront, bottomFront, rightFront, topFront)

################ Use the left half of the game window for leftRear.

#Left viewport: left half
leftRearLeft = 0
bottomRearLeft = height / 2
rightRearLeft = width / 4
topRearLeft = height / 1.5

# set Rear viewport
Left.setViewport( leftRearLeft, bottomRearLeft, rightRearLeft, topRearLeft)

################ Use the top half of the game window for Rear.

#Right viewport: right half
leftRearRight = width / 1.3
bottomRearRight = height / 2
rightRearRight = width
topRearRight = height / 1.5

# set Rear viewport
Right.setViewport( leftRearRight, bottomRearRight, rightRearRight, topRearRight)

################ Use the Viewports

# use viewport
Front.enableViewport(1)
Rear.enableViewport(1)
Left.enableViewport(1)
Right.enableViewport(1)


Thanks for your Help!