WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 10-24-2007, 11:56 AM
arielasso arielasso is offline
Member
 
Join Date: Sep 2007
Posts: 8
thank you.now i face the new problem.why the hand picture did not follow the view. i create the hand object.but it static.i want it follow the view.can you help me?!..or i can't do that request?..
i more problem how can i turn left/right for the view?...u can suggest any gesture..
anywhere i want to say thank you very2 much for helping me...
may god bless u sir..
can u help me again..
thanks a lot..

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 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 09:19 PM.


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