View Single Post
  #1  
Old 10-24-2007, 11:07 AM
arielasso arielasso is offline
Member
 
Join Date: Sep 2007
Posts: 8
Question data glove navigation

Hi, im trying to use 5dt data glove to navigate the 3D environment. i try to use the cameraHandler function, but in that function i cannot call the gesture method. below i try to show what is my idea. anyone can help me how can i navigate the 3D space. i need help as soon as possible.
the main objective that is i want try to do is if i use the data glove and i give the instruction by using index finger point the view can move forward.

any one can help me?!
thanks,
may god bless you.
email: arie_3849@yahoo.com

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
glove = hand.add(sensor,hand.GLOVE_5DT)

##Place the hand in front of the user
glove.rotate(0,-45,0)
viz.MainView.translate(0,0.3,-0.4)
glove.setPosition( 0.03, 0.09, 0.5 )

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



#Add an array with all the gesture names from the 5DT user's manual.
gestureName = ['Fist', 'Index finger point', 'Middle finger point', 
'Two finger point', 'Ring finger point', 'Ring-Index finger point', 
'Ring-middle finger point', 'Three finger point', 'Little finger point', 
'Index and little finger point', 'Little-middle finger point', 
'Not ring finger point', 'Little-ring finger point', 
'Not middle finger point', 'Not index finger point', 
'Flat hand', 'Undefined']

def mytimer(num):
	gesture = int(sensor.get()[-1])
	
	if gesture == 1:
		#Index finger point
		ground.view.move( 0, 0, 1)
	if gesture == 0:
		#Fist
		ground.view.move( 0, 0, -1)
Reply With Quote