View Single Post
  #4  
Old 03-06-2008, 09:17 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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')
Reply With Quote