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
  #3  
Old 06-11-2010, 04:36 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
If you are using the keyboard to update the projections and the joystick to drive the CAVE around you can do something like this.

Code:
#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 (W/2.0,H/2.0,D/2.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)


#update caveorigin with joystick

MOVE_SPEED = 5 # meters/sec

def joyMove():
	
	#Use y position of joystick to drive CAVE forward
	forwardMovement = viz.elapsed() * MOVE_SPEED * -joyPOS[1]
	caveorigin.setPosition([0,0,forwardMovement],viz.REL_LOCAL)
	
	#Use x position of joystick to drive CAVE side to side
	sideMovement = viz.elapsed() * MOVE_SPEED * joyPOS[0]
	caveorigin.setPosition([sideMovement,0,0],viz.REL_LOCAL)
	
vizact.ontimer(0, joyMove)
When using the vizcave module the viewpoint should not be updated with:
Code:
viz.MainView.setPosition()
The viewpoint will update properly if you set a tracker for the CAVE and use the CaveOrigin object to drive the CAVE around.
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 10:55 AM.


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