WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-24-2007, 12:07 PM
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
 

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


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


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