> You can do it :
>
> * create several cameras
>
> * use camera.set_viewport to define the viewport
>
> * use the widget system (from soya.widget) to create a
> soya.widget.Group that you'll use as root widget, and then add the 2
> camera in the group
>
> * you may need to do "camera.partial = 1" for the second camera, to
> avoid clearing twice the background (and erasing the result of the first
> camera)
i tried it myself with:
-----
import sys, os, os.path, soya
import soya.widget as widget
soya.init()
soya.path.append(os.path.join(os.path.dirname(sys.argv[0]), "data"))
scene = soya.World()
sword_model = soya.Shape.get("sword")
class RotatingVolume(soya.Volume):
def advance_time(self, proportion):
soya.Volume.advance_time(self, proportion)
self.rotate_lateral(proportion * 5.0)
sword = RotatingVolume(scene, sword_model)
light = soya.Light(scene)
light.set_xyz(0.5, 0.0, 2.0)
light2 = soya.Light(scene)
light2.set_xyz(0.5, 0.0, -2.0)
camera1 = soya.Camera(scene)
camera1.z = 3.0
camera2 = soya.Camera(scene)
camera2.z = -3.0
camera2.look_at( soya.Point( scene, 0,0,0))
camera2.partial = 1
soya.set_root_widget(widget.Group())
soya.root_widget.add(camera1)
soya.root_widget.add(camera2)
hh=soya.root_widget.height/2
camera1.set_viewport(0,0,soya.root_widget.width,hh)
camera2.set_viewport(0,hh,soya.root_widget.width,hh)
camera1.partial=0
camera2.partial=1
soya.Idler(scene).idle()
---
it doesnt seem to matter how i set partial, one or both views appear half as
bright as
they should do.
dunk