WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-24-2007, 02:24 PM
arielasso arielasso is offline
Member
 
Join Date: Sep 2007
Posts: 8
coding below i created to try turn left/right for the navigation. but it just go left and right for the same view. i dont know how can i turn it left/right.

one more thing. can i create a new gesture and call it into vizard?
i'm so sorry if i bothering you.
i hope you can help me to solve my problem.
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
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,-70,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())
	if gesture == hand.GESTURE_FIST:
		#Fist
		viz.MainView.move( 0, 0, -1*viz.elapsed())
	if gesture == hand.GESTURE_TWO_FINGER:
		#Two finger point
		viz.MainView.move( 1*viz.elapsed(), 0, 0 )
	if gesture == hand.GESTURE_LITTLE_FINGER:
		#Tumb up
		viz.MainView.move( -1*viz.elapsed(), 0, 0 )
		
	
		
vizact.ontimer(0,UpdateView)
Reply With Quote
  #2  
Old 10-24-2007, 02:28 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
If you want to turn left/right instead of moving left/right using the following code:
Code:
#Turn right
viz.MainView.setEuler(90*viz.elapsed(),0,0,viz.HEAD_ORI,viz.REL_LOCAL)

#Turn left
viz.MainView.setEuler(-90*viz.elapsed(),0,0,viz.HEAD_ORI,viz.REL_LOCAL)
I'm sorry, I don't understand your second question.
Reply With Quote
  #3  
Old 10-24-2007, 03:15 PM
arielasso arielasso is offline
Member
 
Join Date: Sep 2007
Posts: 8
for the second question is i want create a new gesture.

5dt glove have application to create new gesture.so i create the new gesture to make the navigation in vizard.

i create the gesture and i saved it as EDIT. the gesture is like this thumb= unflexed index=unflexed middle=flexed ring=flexed and little=flexed.

so i try to call the "edit" gesture. like this
Code:
gesture == hand.GESTURE_EDIT:
		#Tumb up
viz.MainView.setEuler(-90*viz.elapsed(),0,0,viz.HEAD_ORI,viz.REL_LOCAL)
but i was error.
i hope you can help me.
thanks a lot
Reply With Quote
Reply


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 05:17 AM.


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