PDA

View Full Version : setup two wall system with one single PC and one quadro graphics card


vrmdl
04-27-2012, 10:46 AM
Hi,

I am trying to set up a two wall system (front and bottom) which is powered by a single PC and single graphics card (Quadro FX 6000). I am struggling with the setup.

I am creating two windows. Each image is projected to each window. However the image of front window and image of bottom window is not continuous. Could one of you give me a hint? Here is my code. Thanks.


# Declare constants defining the CAVE dimensions
W = 3.410 # 10 feet wide
H = 2.140 #7.5 feet tall
D = 2.200 # 7.5 feet deep

C0 = -W/2,H/2,-D/2 # Front Wall: C1,C2,C5,C6
C1 = -W/2,H/2,D/2 # Left Wall: C0,C1,C4,C5
C2 = W/2,H/2,D/2 # Right Wall: C2,C3,C6,C7
C3 = W/2,H/2,-D/2 # Bottom Wall: C5,C6,C4,C7
C4 = -W/2,-H/2,-D/2
C5 = -W/2,-H/2,D/2
C6 = W/2,-H/2,D/2
C7 = W/2,-H/2,-D/2

#Create front wall
FrontWall = vizcave.Wall( upperLeft=C1, # 0, 2.286, 3.048
upperRight=C2, # 3.048, 2.286, 3.048
lowerLeft=C5, # 0, 0, 3.048
lowerRight=C6, # 3.048, 0, 3.048
name='Front Wall' )

#Create left wall
LeftWall = vizcave.Wall( upperLeft=C0,
upperRight=C1,
lowerLeft=C4,
lowerRight=C5,
name='Left Wall' )

#Create right wall
RightWall = vizcave.Wall( upperLeft=C2,
upperRight=C3,
lowerLeft=C6,
lowerRight=C7,
name='Right Wall' )

#Create bottom wall
BottomWall = vizcave.Wall( upperLeft=C5,
upperRight=C6,
lowerLeft=C4,
lowerRight=C7,
name='Bottom Wall' )

#Initialize graphics window
viz.go(viz.FULLSCREEN)
#viz.go(viz.FULLSCREEN|viz.QUAD_BUFFER)

#Create cave object
cave = vizcave.Cave()

frontWindow=viz.MainWindow
frontWindow.setSize(1,.5)
frontWindow.setPosition([0,1])
cave.addWall(FrontWall, window = frontWindow)

bottomWindow = viz.addWindow()
bottomWindow.setSize(1,.5)
bottomWindow.setPosition([0,0.5])
cave.addWall(BottomWall, window = bottomWindow)

farshizzo
04-27-2012, 11:51 AM
Can you post the full script you are using? I modified your setup to add a view tracker and a model and the front/bottom walls seem to line up correctly. Here is the script if you want to try it out. Use the mouse and arrow keys to navigate the virtual viewpoint around the gallery.
import viz
import vizcave
import viztracker

# Declare constants defining the CAVE dimensions
W = 3.410 # 10 feet wide
H = 2.140 #7.5 feet tall
D = 2.200 # 7.5 feet deep

C0 = -W/2,H/2,-D/2 # Front Wall: C1,C2,C5,C6
C1 = -W/2,H/2,D/2 # Left Wall: C0,C1,C4,C5
C2 = W/2,H/2,D/2 # Right Wall: C2,C3,C6,C7
C3 = W/2,H/2,-D/2 # Bottom Wall: C5,C6,C4,C7
C4 = -W/2,-H/2,-D/2
C5 = -W/2,-H/2,D/2
C6 = W/2,-H/2,D/2
C7 = W/2,-H/2,-D/2

#Create front wall
FrontWall = vizcave.Wall( upperLeft=C1, # 0, 2.286, 3.048
upperRight=C2, # 3.048, 2.286, 3.048
lowerLeft=C5, # 0, 0, 3.048
lowerRight=C6, # 3.048, 0, 3.048
name='Front Wall' )

#Create left wall
LeftWall = vizcave.Wall( upperLeft=C0,
upperRight=C1,
lowerLeft=C4,
lowerRight=C5,
name='Left Wall' )

#Create right wall
RightWall = vizcave.Wall( upperLeft=C2,
upperRight=C3,
lowerLeft=C6,
lowerRight=C7,
name='Right Wall' )

#Create bottom wall
BottomWall = vizcave.Wall( upperLeft=C5,
upperRight=C6,
lowerLeft=C4,
lowerRight=C7,
name='Bottom Wall' )

#Initialize graphics window
viz.go(viz.FULLSCREEN)
#viz.go(viz.FULLSCREEN|viz.QUAD_BUFFER)

#Create cave object
cave = vizcave.Cave()

frontWindow=viz.MainWindow
frontWindow.setSize(1,.5)
frontWindow.setPosition([0,1])
cave.addWall(FrontWall, window = frontWindow)

bottomWindow = viz.addWindow()
bottomWindow.setSize(1,.5)
bottomWindow.setPosition([0,0.5])
cave.addWall(BottomWall, window = bottomWindow)

#Create tracker object using the keyboard (WASD keys control the viewpoint, the user's eye location)
#Make the starting location for the user's eye above origin
viewtracker = viztracker.KeyboardPos()
viewtracker.setPosition(0.0,0.0,0.0)

#Pass the viewpoint tracker into the cave object so it can be automatically updated
cave.setTracker(pos=viewtracker)

#Create CaveView object for manipulating the entire cave environment
#The caveorigin is a node that can be adjusted to move the entire cave around the virtual environment
caveorigin = vizcave.CaveView(viewtracker)

#Create another tracker using the keyboard and mouse (arrow keys adjust position, mouse changes orientation)
origintracker = viztracker.KeyboardMouse6DOF()
origintracker.setPosition(0,1.5,0)

#Link the keyboard/mouse so that it moves the cave and user around the virtual environment
originlink = viz.link (origintracker, caveorigin)

#Add gallery environment model
viz.add('gallery.osgb')

vrmdl
04-27-2012, 03:24 PM
I used your model. I still see some discontinuity at the edge. With stereo is turned on, it looks like the floor image on the bottom screen is higher than the floor image on the front screen. Could this because my dimensions are not correct?

farshizzo
04-27-2012, 04:12 PM
When enabling stereo, make sure you apply the stereo mode to all windows. For example, if you are using viz.QUAD_BUFFER stereo, then you will need to apply it to both windows:frontWindow.stereo(viz.QUAD_BUFFER)
bottomWindow.stereo(viz.QUAD_BUFFER)

vrmdl
04-27-2012, 09:19 PM
I have no problem with stereo. The problem is that the floor image is not continuous with the front image at the edge. If I manually offset the floor image down for about -0.6, the image seems align with the front image quite well, i.e. the codes look like (the rest is the same)

C4 = -W/2,-H/2-0.5,-D/2
C5 = -W/2,-H/2-0.5,D/2
C6 = W/2,-H/2-0.5,D/2
C7 = W/2,-H/2-0.5,-D/2

The value "0.5" is obtained by trial and error. Is there any reason for this phenomenon?

vrmdl
04-28-2012, 02:10 PM
Hi,

Thanks for your reply. I found a strange thing in my codes. I ran exactly the same code as in the following. I found the image is correct every other run. In other words, the first time run gives a correct image. While in the second run, I got a wrong image. If I have a third run, I got a correct image again. Can anyone help me with it? Thanks.

The following codes simply draw a straight line and link to a my fly stick.


import viz
import vizact
import vizcam
import vizcave
import viztracker


# Declare constants defining the CAVE dimensions
W = 3.410 # 10 feet wide
H = 2.140 #7.5 feet tall
D = 2.200 # 7.5 feet deep

offset_bottom_wall=0.0

C0 = -W/2,H/2,-D/2 # Front Wall: C1,C2,C5,C6
C1 = -W/2,H/2-offset_bottom_wall,D/2 # Left Wall: C0,C1,C4,C5
C2 = W/2,H/2-offset_bottom_wall,D/2 # Right Wall: C2,C3,C6,C7
C3 = W/2,H/2,-D/2 # Bottom Wall: C5,C6,C4,C7

C4 = -W/2,-H/2-offset_bottom_wall,-D/2
C5 = -W/2,-H/2-offset_bottom_wall,D/2
C6 = W/2,-H/2-offset_bottom_wall,D/2
C7 = W/2,-H/2-offset_bottom_wall,-D/2

#Create front wall
FrontWall = vizcave.Wall( upperLeft=C1, # 0, 2.286, 3.048
upperRight=C2, # 3.048, 2.286, 3.048
lowerLeft=C5, # 0, 0, 3.048
lowerRight=C6, # 3.048, 0, 3.048
name='Front Wall' )

#Create bottom wall
BottomWall = vizcave.Wall( upperLeft=C5,
upperRight=C6,
lowerLeft=C4,
lowerRight=C7,
name='Bottom Wall' )

#Create cave object
cave = vizcave.Cave()

frontWindow=viz.MainWindow
frontWindow.setSize(1,.5)
frontWindow.setPosition([0,1])
cave.addWall(FrontWall, window = frontWindow)

bottomWindow = viz.addWindow()
bottomWindow.setSize(1,.5)
bottomWindow.setPosition([0,0.5])
cave.addWall(BottomWall, window = bottomWindow)

frontWindow.stereo(viz.QUAD_BUFFER)
bottomWindow.stereo(viz.QUAD_BUFFER)

#Create tracker object using the keyboard (WASD keys control the viewpoint, the user's eye location)
#Make the starting location for the user's eye above origin
viewtracker = viztracker.KeyboardPos()
viewtracker.setPosition([0.0,0,0.0])

#Pass the viewpoint tracker into the cave object so it can be automatically updated
cave.setTracker(pos=viewtracker,ori=viewtracker)

#Create CaveView object for manipulating the entire cave environment
#The caveorigin is a node that can be adjusted to move the entire cave around the virtual environment
caveorigin = vizcave.CaveView(viewtracker)

#Create another tracker using the keyboard and mouse (arrow keys adjust position, mouse changes orientation)
origintracker = viztracker.KeyboardMouse6DOF()
origintracker.setPosition(0,0.5,0)

#Link the keyboard/mouse so that it moves the cave and user around the virtual environment
originlink = viz.link (origintracker, caveorigin)


vrpn = viz.add('vrpn7.dle') # can be vrpn6.dle or vrpn7.dle depending on vrpn version
headTrkr = vrpn.addTracker('DTrack@localhost',0)
flyTrkr = vrpn.addTracker('DTrack@localhost',2)
flyStick_button = vrpn.addButton('DTrack@localhost')
joystick = vrpn.addAnalog('DTrack@localhost')

#Negate Z value of position
flyTrkr.swapPos([1,2,-3])
#Negate X,Y value of quaternion
flyTrkr.swapQuat([-1,-2,3,4])


#Create line of length 1
length=10
viz.startlayer(viz.LINES)
viz.vertexColor(viz.GREEN)
viz.lineWidth(4)
viz.vertex(0,0,0)
viz.vertex(0,0,length)
pointer_line = viz.endlayer()
pointer_line.dynamic()

link_pointer = viz.link( flyTrkr, pointer_line )

viz.go(viz.FULLSCREEN|viz.QUAD_BUFFER)

vrmdl
04-28-2012, 02:56 PM
Hi,

Thanks for your reply. I found a strange thing in my codes. I ran exactly the same code as in the following. I found the image is correct every other run. In other words, the first time run gives a correct image. While in the second run, I got a wrong image. If I have a third run, I got a correct image again. Can anyone help me with it? Thanks.

The following codes simply draw a straight line and link to a my fly stick.


import viz
import vizact
import vizcam
import vizcave
import viztracker


# Declare constants defining the CAVE dimensions
W = 3.410 # 10 feet wide
H = 2.140 #7.5 feet tall
D = 2.200 # 7.5 feet deep

offset_bottom_wall=0.0

C0 = -W/2,H/2,-D/2 # Front Wall: C1,C2,C5,C6
C1 = -W/2,H/2-offset_bottom_wall,D/2 # Left Wall: C0,C1,C4,C5
C2 = W/2,H/2-offset_bottom_wall,D/2 # Right Wall: C2,C3,C6,C7
C3 = W/2,H/2,-D/2 # Bottom Wall: C5,C6,C4,C7

C4 = -W/2,-H/2-offset_bottom_wall,-D/2
C5 = -W/2,-H/2-offset_bottom_wall,D/2
C6 = W/2,-H/2-offset_bottom_wall,D/2
C7 = W/2,-H/2-offset_bottom_wall,-D/2

#Create front wall
FrontWall = vizcave.Wall( upperLeft=C1, # 0, 2.286, 3.048
upperRight=C2, # 3.048, 2.286, 3.048
lowerLeft=C5, # 0, 0, 3.048
lowerRight=C6, # 3.048, 0, 3.048
name='Front Wall' )

#Create bottom wall
BottomWall = vizcave.Wall( upperLeft=C5,
upperRight=C6,
lowerLeft=C4,
lowerRight=C7,
name='Bottom Wall' )

#Create cave object
cave = vizcave.Cave()

frontWindow=viz.MainWindow
frontWindow.setSize(1,.5)
frontWindow.setPosition([0,1])
cave.addWall(FrontWall, window = frontWindow)

bottomWindow = viz.addWindow()
bottomWindow.setSize(1,.5)
bottomWindow.setPosition([0,0.5])
cave.addWall(BottomWall, window = bottomWindow)

frontWindow.stereo(viz.QUAD_BUFFER)
bottomWindow.stereo(viz.QUAD_BUFFER)

#Create tracker object using the keyboard (WASD keys control the viewpoint, the user's eye location)
#Make the starting location for the user's eye above origin
viewtracker = viztracker.KeyboardPos()
viewtracker.setPosition([0.0,0,0.0])

#Pass the viewpoint tracker into the cave object so it can be automatically updated
cave.setTracker(pos=viewtracker,ori=viewtracker)

#Create CaveView object for manipulating the entire cave environment
#The caveorigin is a node that can be adjusted to move the entire cave around the virtual environment
caveorigin = vizcave.CaveView(viewtracker)

#Create another tracker using the keyboard and mouse (arrow keys adjust position, mouse changes orientation)
origintracker = viztracker.KeyboardMouse6DOF()
origintracker.setPosition(0,0.5,0)

#Link the keyboard/mouse so that it moves the cave and user around the virtual environment
originlink = viz.link (origintracker, caveorigin)


vrpn = viz.add('vrpn7.dle') # can be vrpn6.dle or vrpn7.dle depending on vrpn version
headTrkr = vrpn.addTracker('DTrack@localhost',0)
flyTrkr = vrpn.addTracker('DTrack@localhost',2)
flyStick_button = vrpn.addButton('DTrack@localhost')
joystick = vrpn.addAnalog('DTrack@localhost')

#Negate Z value of position
flyTrkr.swapPos([1,2,-3])
#Negate X,Y value of quaternion
flyTrkr.swapQuat([-1,-2,3,4])


#Create line of length 1
length=10
viz.startlayer(viz.LINES)
viz.vertexColor(viz.GREEN)
viz.lineWidth(4)
viz.vertex(0,0,0)
viz.vertex(0,0,length)
pointer_line = viz.endlayer()
pointer_line.dynamic()

link_pointer = viz.link( flyTrkr, pointer_line )

viz.go(viz.FULLSCREEN|viz.QUAD_BUFFER)

vrmdl
04-30-2012, 06:59 PM
can anyone give me hint on what is going on with my code? Thanks.

farshizzo
05-01-2012, 12:31 PM
Do you see the discontinuity between the two windows when viewing on a desktop? If so, can you post a screenshot.

Or do you only see the discontinuity when viewing on the actual projected surface of your CAVE? If so, then your projectors might not be properly aligned.

vrmdl
05-26-2012, 03:46 PM
Do you see the discontinuity between the two windows when viewing on a desktop? If so, can you post a screenshot.

Or do you only see the discontinuity when viewing on the actual projected surface of your CAVE? If so, then your projectors might not be properly aligned.

Hi,

I am currently working on a two wall system which is driven by the same computer and one graphics card. I generated one front image and one floor image.

The screenshot is attached. Is this due to the projector alignment problem?

Thanks.

farshizzo
05-29-2012, 10:27 AM
Are you sure the dimensions of the wall you are specifying in your script match the physical dimensions of the projected image? Also, the physical coordinates of the wall must be in the same coordinate frame as the tracker you are using to track the users head position.

vrmdl
05-29-2012, 10:59 AM
Are you sure the dimensions of the wall you are specifying in your script match the physical dimensions of the projected image? Also, the physical coordinates of the wall must be in the same coordinate frame as the tracker you are using to track the users head position.

I am sure the dimensions of the wall is correct. I am not currently using any physical tracking system. The cave center is assumed to the origin of the coordinate system.

I suspect if the left and right eye image of the bottom screen are swapped while it is not for the front screen. How do I swap images for a particular screen. Is this possible in vizard?

The complete code is listed below.
*****************
import viz
import vizcave
import viztracker

# Declare constants defining the CAVE dimensions
W = 3.410 # 10 feet wide
H = 2.140 #7.5 feet tall
D = 2.200 # 7.5 feet deep

C0 = -W/2,H/2,-D/2 # Front Wall: C1,C2,C5,C6
C1 = -W/2,H/2,D/2 # Left Wall: C0,C1,C4,C5
C2 = W/2,H/2,D/2 # Right Wall: C2,C3,C6,C7
C3 = W/2,H/2,-D/2 # Bottom Wall: C5,C6,C4,C7
C4 = -W/2,-H/2,-D/2
C5 = -W/2,-H/2,D/2
C6 = W/2,-H/2,D/2
C7 = W/2,-H/2,-D/2

#Create front wall
FrontWall = vizcave.Wall( upperLeft=C1, # 0, 2.286, 3.048
upperRight=C2, # 3.048, 2.286, 3.048
lowerLeft=C5, # 0, 0, 3.048
lowerRight=C6, # 3.048, 0, 3.048
name='Front Wall' )

#Create left wall
LeftWall = vizcave.Wall( upperLeft=C0,
upperRight=C1,
lowerLeft=C4,
lowerRight=C5,
name='Left Wall' )

#Create right wall
RightWall = vizcave.Wall( upperLeft=C2,
upperRight=C3,
lowerLeft=C6,
lowerRight=C7,
name='Right Wall' )

#Create bottom wall
BottomWall = vizcave.Wall( upperLeft=C5,
upperRight=C6,
lowerLeft=C4,
lowerRight=C7,
name='Bottom Wall' )

#Initialize graphics window
viz.go(viz.FULLSCREEN)
#viz.go(viz.FULLSCREEN|viz.QUAD_BUFFER)

#Create cave object
cave = vizcave.Cave()

frontWindow=viz.MainWindow
frontWindow.setSize(1,.5)
frontWindow.setPosition([0,1])
cave.addWall(FrontWall, window = frontWindow)

bottomWindow = viz.addWindow()
bottomWindow.setSize(1,.5)
bottomWindow.setPosition([0,0.5])
cave.addWall(BottomWall, window = bottomWindow)

#Create tracker object using the keyboard (WASD keys control the viewpoint, the user's eye location)
#Make the starting location for the user's eye above origin
viewtracker = viztracker.KeyboardPos()
viewtracker.setPosition(0.0,0.0,0.0)

#Pass the viewpoint tracker into the cave object so it can be automatically updated
cave.setTracker(pos=viewtracker)

#Create CaveView object for manipulating the entire cave environment
#The caveorigin is a node that can be adjusted to move the entire cave around the virtual environment
caveorigin = vizcave.CaveView(viewtracker)

#Create another tracker using the keyboard and mouse (arrow keys adjust position, mouse changes orientation)
origintracker = viztracker.KeyboardMouse6DOF()
origintracker.setPosition(0,1.5,0)

#Link the keyboard/mouse so that it moves the cave and user around the virtual environment
originlink = viz.link (origintracker, caveorigin)

#Add gallery environment model
viz.add('gallery.osgb')