Hi guys, I’m a student at the ETC Global (portugal program) and as some of you know, we’re building our own CAVE here, with 4 walls rather than 3…i’ve been looking around the code and I was wondering if someone could tell me if this is right. The goal is to project on 4 screens at once…I have 5 screens now, and one puppet, not sure about the coordinates though! Any ideas? Thanks, António Gomes
# are we in the cave
INCAVE = 0 # 0 = no, 1 = yes
# window PRCfile data - index 0 is not in cave, 1 is in cave
PRC_ORIGIN = [["win-origin 0 50", "win-origin 400 50", "win-origin 800 50", "win-origin 800 400", "win-origin 1200 400"],
["win-origin -1024 -768", "win-origin 0 -768", "win-origin 1024 -768", "win-origin 100 100","win-origin 0 0"]]
PRC_SIZE = ["win-size 320 240", "win-size 1024 768"]
PRC_DEC = ["undecorated 0", "undecorated 1"]
import direct.directbase.DirectStart
from direct.showbase.DirectObject import DirectObject
from pandac.PandaModules import *
from direct.gui.DirectGui import *
from direct.task import Task
from direct.actor.Actor import Actor
from direct.interval.IntervalGlobal import *
import math
import sys
from VARS import *
class World(DirectObject):
def __init__(self):
# setup the cameras
self.screenSet()
# set the background color
base.setBackgroundColor( .2, .2, .2 )
# load enviro model
self.terrain = loader.loadModel("models/environment.egg")
self.terrain.reparentTo(render)
# setup controls
self.keys = {'w':False, 'a':False, 's':False, 'd':False, 'r':False, 'f':False,
'q':False, 'e':False, 't':False, 'g':False}
# setup the left, center, and right cameras to render the desired node
base.camList[0].node().setScene(render) # puppet
base.camList[1].node().setScene(render) # left
base.camList[2].node().setScene(render) # center
base.camList[3].node().setScene(render) # right
base.camList[4].node().setScene(render) # back
# adjust lens
lens = PerspectiveLens()
lens.setFov(VBase2(45, 30))
lens.setNearFar(1.0, 100000.0)
for i in range(0,4):
base.camList[i].node().setLens(lens)
w = World()
run()