WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 10-24-2007, 12:30 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Here's a modified version of the script that will always place the glove in front of the user. You can use other gestures to control left/right movement. Or, if you have an orientation tracker device, such as the Intersense IneriaCube, you could use that to steer the viewpoint as well.
Code:
import viz
import hand
viz.go()

#Identify the data glove's port.
PORT_5DT = 1

#Add the 5DT sensor
sensor = viz.add('5dt.dls')

##Create a hand object from the data glove
overlayView = viz.addView()
overlayView.setScene(4)
overlay = viz.addWindow(pos=(0,1),size=(1,1),clearMask=viz.GL_DEPTH_BUFFER_BIT,view=overlayView)
glove = hand.add(sensor,hand.GLOVE_5DT,scene=4,pos=(0,1.5,1.5),euler=(0,-90,0))

#Initialize world
viz.clearcolor( viz.GRAY )
ground = viz.add( 'tut_ground.wrl' )

def UpdateView():
	gesture = glove.getGesture()
	
	if gesture == hand.GESTURE_INDEX_FINGER:
		#Index finger point
		viz.MainView.move( 0, 0, 1*viz.elapsed())
	elif gesture == hand.GESTURE_FIST:
		#Fist
		viz.MainView.move( 0, 0, -1*viz.elapsed())
	
		
vizact.ontimer(0,UpdateView)
Reply With Quote
 


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


All times are GMT -7. The time now is 10:36 PM.


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