Hello everyone!
I have two scripts to set two different cameras while playing.
Too see it in action please download the .blend file attached to this post. (CameraProblem.blend) press “p” and then press “2” to set both cameras.
The scripts work fine but since the .blend file starts using the right camera it gets distorted when I initialize the scripts at the same time.
Here is a pic to give you an idea:
The left camera script:
## Updated to Blender 2.6 by Andre Ortiz and HG1
# import bge
import bge
# get controller
cont = bge.logic.getCurrentController()
# get owner
own = cont.owner
# get Window width
width = bge.render.getWindowWidth()
# get Window height
height = bge.render.getWindowHeight()
# set viewport
own.setViewport(0, 0, int(width * 1/2), int(height))
# enable viewport
own.useViewport = True
And the right camera script:
## Updated to Blender 2.6 by Andre Ortiz and HG1
# Import bge
import bge
# get controller
cont = bge.logic.getCurrentController()
#Get the owner
own = cont.owner
# get Window width
width = bge.render.getWindowWidth()
# get Window height
height = bge.render.getWindowHeight()
# set viewport
own.setViewport(int(width * 1/2), 0, int(width), int(height))
# enable viewport
own.useViewport = True
Thank you very much for your time,
Ortiz
Attachments
CameraProblem.blend (412 KB)