scripting for CAVE

Hi:

I’m trying to set my virtual world for CAVE display. Our CAVE has three screens, with each of them has 6 feet width and 4.5 feet height. What I’m trying now is driving it in one computer and open three windows for each of the screen (each window has one camera). I have two questions:

  1. How to set the positions of the three windows so that when the program starts it will fill and fit the three screes of CAVE? (I guess it is related with “win-origin x y”, but I’m confused what does x y mean here.)

  2. I was able to open three windows on my laptop to do the navigation test. I want to use keyboard to control the move of camera for first-person view navigation. I already made it work for one camera. But when it comes to three cameras, it seems they are not pointing at the right direction to complete the peripheral view. I guess it may be something wrong with my camera position setting or navigation.
    Here is my code for positioning the base and three cameras:

base.camList[0].setHpr(0, 0, 0)             #base 
base.camList[1].setHpr(45, 0, 0)            #left      
base.camList[2].setHpr(0, 0, 0)             #center
base.camList[3].setHpr(-45, 0, 0)           #right

Then is the code for navigation

def turn(self, dir, dt):
        turnRate = self.handling * (2 -
            (self.speed / self.maxSpeed))
        if(dir == "r"): turnRate = -turnRate
        for i in xrange(4):
            base.camList[i].setH(base.camList[i], turnRate * dt)
    
def moveCamera(self, task):       
        dt = globalClock.getDt()
        if(dt > .20):
            return task.cont
        if(self.keyMap["w"] == True):
            for i in xrange(4):
              base.camList[i].setY(base.camList[i],0.1)
        elif(self.keyMap["s"] == True):
            for i in xrange(4):
              base.camList[i].setY(base.camList[i],-0.1)
        elif(self.keyMap["d"] == True):
            self.turn("r" , dt)
        elif(self.keyMap["a"] == True):
            self.turn("a" , dt)
        return task.cont

Please help me find out what’s the problem. Thanks a lot!

Hi,

The “x y” of win-origin refer to the desktop coordinates of the upper-left corner of the window. For instance, “win-origin 1280 0” would open a window at desktop coordinate (1280, 0), which might be where the first CAVE projector is located on your desktop (assuming you have a 1280x800 desktop and you have arranged your screens to the right of your primary desktop).

But it’s usually better to open one single large window that covers the entire desktop, and subdivide into DisplayRegions, instead of trying to open a different window for each projector. Here’s a thread topic where we had a similar discussion:

[OpenGL (extended monitors) error)

As to your move camera task, I suggest you simply move base.camera, which is the parent node of all of the cameras in base.camList, rather than trying to move the individual cameras separately. Moving base.camera will work regardless of how many cameras you have.

David