WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
Old 06-10-2010, 09:12 AM
esuna114 esuna114 is offline
Join Date: Jun 2010
Posts: 2
[New here] Cave joy navigation

Hello everybody,

I'm very new to Vizard, so maybe my questions will be stupid.
Right now i've got a problem with joystick navigation in my cave. I've tried to make it from examples. (We have no tracking devices for now)

Here is the cave file:

# The same script must be run on all machines in the cluster

import viz
import vizcave
import viztracker

# Activate full screen on all nodes with quad buffering

# Disable the mouse cursor visibility on all machines except the master
viz.cluster.setMask(viz.ALLCLIENTS & ~viz.MASTER)

# Declare constants defining the CAVE dimensions
W1 = 3.048			# wideness 	(X)
H1 = 2.286			# height	(Y)
D1 = 0.56			# deepnees 	(Z)

C0 = -2,2.25,2      # Front  Wall: C0,C1,C2,C3
C1 = 2,2.25,2      # Roof   Wall: C4,C5,C0,C1
C2 = -2,0,2      
C3 = 2,0,2     
C4 = -2,3.9736,0.5537
C5 = 2,3.9736,0.5537

#Create front wall
FrontWall = vizcave.Wall(   upperLeft=C0,  
                            name='Front Wall' )

#Create left wall
RoofWall  = vizcave.Wall(   upperLeft=C4,
                            name='Roof Wall' )

#Initialize graphics window

#Create cave object
LITE = vizcave.Cave()

#Add each wall, make sure that they are ordered in the cluster software correctly to match this ordering
LITE.addWall(FrontWall, mask=viz.CLIENT2) 
LITE.addWall(RoofWall, mask=viz.CLIENT1)

import joyLITE

#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 the exact center of the CAVE
viewtracker = viztracker.KeyboardPos()
viewtracker.setPosition (0,1.7,0)

#Pass the viewpoint tracker into the cave object so it can be automatically updated

#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()
#originlink = (origintracker, caveorigin)

#Set the MainView in a good position
vpos= caveorigin.getPosition()
vrot= caveorigin.getEuler()


originlink = ( caveorigin,viz.MainView)

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

#Add gallery environment model
gallery = viz.add('gallery.ive')
And here is my joy navigation device ( joyLITE )

import vizact
import viz

#Import the vizjoy module and add one joystick.
import vizjoy
joy = vizjoy.add()

def update_joystick():
	node3d = viz.MainView
	#Get the joystick position
	x,y,z = joy.getPosition()
	#Get the twist of the joystick
	twist = joy.getTwist()
	slider = joy.getSlider()
	state = joy.getButtonState()
	#Move the viewpoint forward/
	#backward based on y-axis value
	#Make sure value is above a certain
	if abs(x) > 0.2:
	#Move the viewpoint left/right based
	#on x-axis value. Make sure value is
	#above a certain threshold
	if abs(y) > 0.2:
	#Turn the viewpoint left/right based
	#on twist value. Make sure value is
	#above a certain threshold.
	if abs(slider) > 0.2:
	if abs(twist) > 0.2:
	#Up/down with buttons
	if state & vizjoy.BUTTON6:
	if state & vizjoy.BUTTON8:

#UpdateJoystick every frame
The rotations are very weird, and the view won't translate at all, why so?
I tried my joystick navigation file with another non-cave demo and it worked well.

Thank you by advance.
Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mouselook & Keyboard Navigation EnvisMJ Vizard 9 06-22-2010 04:52 PM
Flipped floor in a CAVE shivanangel Vizard 1 03-10-2010 10:12 AM
CAVE, navigation, tracked wand, coordinate systems JimC Vizard 6 10-09-2009 12:43 PM
right-hand to left-hand coordinate System for a cave setup Andy Vizard 1 09-16-2009 10:17 AM
navigation in cave environment Andy Vizard 4 03-28-2008 01:32 AM

All times are GMT -7. The time now is 01:55 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC