![]() |
|
|
|
#1
|
|||
|
|||
|
It seems to work fine for me. I created this small test that uses the arrow keys to move the view left/right/up/down. As you move to the edges of the cave wall, the image starts to skew.
Code:
import viz
import vizcave
viz.go()
c0 = -2,3,0
c1 = 2,3,0
c2 = 2,0,0
c3 = -2,0,0
vp = [0, 1.8, -2]
cave = vizcave.Cave()
FrontWall = vizcave.Wall(upperLeft=c0,upperRight=c1,lowerLeft= c3,lowerRight=c2,name='Front Wall' )
cave.addWall(FrontWall, mask =None, window = viz.MainWindow)
def UpdateCave():
if viz.key.isDown(viz.KEY_LEFT):
vp[0] -= 1*viz.elapsed()
if viz.key.isDown(viz.KEY_RIGHT):
vp[0] += 1*viz.elapsed()
if viz.key.isDown(viz.KEY_UP):
vp[1] += 1*viz.elapsed()
if viz.key.isDown(viz.KEY_DOWN):
vp[1] -= 1*viz.elapsed()
cave.update(pos = vp)
viz.MainView.translate(vp)
vizact.ontimer(0,UpdateCave)
viz.add('gallery.ive')
|
|
#2
|
|||
|
|||
|
VizCave problem resolved
Thank you very much for providing this code, which helped me to resolve the problem. Apparently one has to update the current head position i two different places to make this work. BOTH in the cave object (cave.update()) AND in the main view (viz.MainView.translate()). This appears a little counterintuitive - but once you know it you can live with it...
Thanks again, stefs |
|
#3
|
|||
|
|||
|
Yes, this seems to confuse a lot of people. The reason is that the the cave.update() function only needs to know the physical head position. The virtual head position can be something completely different, in this case it happens to be the same as the physical head position.
|
|
#4
|
|||
|
|||
|
Quote:
The CAVE can be moved around anywhere within the environment, but that doesn't change the virtual or physical head locations relative to the CAVE frame of reference, right? |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Same code in different files but one not working | tacbob | Vizard | 3 | 03-05-2007 09:30 AM |
| Vizard 3.0 beta activation code | vnacooper | Vizard | 3 | 09-21-2006 12:03 PM |
| starter code for 3 ppt lights | vsully | Vizard | 1 | 09-21-2005 11:23 AM |
| Code Jumps under load | Johannes | Vizard | 11 | 03-29-2005 12:27 PM |
| Vizard Crashes: causes are hard to determine, possible problem with the viz code | vr_boyko | Vizard | 1 | 01-07-2005 10:52 AM |