WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 07-28-2010, 12:30 PM
znchb znchb is offline
Member
 
Join Date: Sep 2008
Posts: 21
# I just tried and get this work well: orientation & position for one of those 4 # sensers. (try to link View with just one Sensor, each try works.)
# Now I'm trying to use sensor 1 to control orientation& position

# and using sensor 2 to replace mouse
# sensor 3 & 4 replace left hand and right hand
# for sensor 2,3,4, could you give me any idea ? thanks

import viz
import viztracker
viz.go()
viz.clearcolor(viz.BLUE)
gallery = viz.add('gallery.ive')
view = viz.get(viz.MAIN_VIEWPOINT)
#tracker = sensor.addTracker()###error
#viz.tracker()
PORT_INTERSENSE = 1
sensor1 = viz.add('intersense.dls')
PORT_INTERSENSE = 2
sensor2 = viz.add('intersense.dls')
PORT_INTERSENSE = 3
sensor3 = viz.add('intersense.dls')
PORT_INTERSENSE = 4
sensor4 = viz.add('intersense.dls')
# link which sensor, which sensor will
# control the view orientation and walk position
S = sensor1
link = viz.link( S, view )#link the senser to view: perform orientation and #position with head tracker

def ontimer(num):
#the original pos and euler are [0.0, 0.0, 0.0]
pos = S.getPosition()
euler = S.getEuler()
print pos
print euler
viz.MainView.setPosition(pos[0]*10,pos[1]+1.82,pos[2]*10)
viz.MainView.setEuler(euler[0],euler[1],euler[2])

viz.callback(viz.TIMER_EVENT, ontimer)
viz.starttimer(0, 0.01, viz.FOREVER)
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 06:05 AM.


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