View Single Post
  #3  
Old 12-12-2003, 12:55 PM
david david is offline
Member
 
Join Date: Mar 2003
Posts: 23
need more explanations

Thanks for your answer Farshizzo but I still don't understand.

I ran the following lines:

headTrack = viz.addsensor('is600')
#is600 is a custom plug-in that can track two sensors
headView = viz.add(viz.VIEWPOINT)
headView.link(headTrack,0)

And I got the error
Traceback (most recent call last):
File "<string>", line 2, in ?
File "test_attach_other_viewpoint.py", line 13, in ?
headView.link(headTrack,0)
File "C:\Program Files\Vizard20\viz.py", line 1354, in link
_ipcSend(_VIZ_LINKVIEW,self.id,sensor,id,'',mask,0 ,0,0)
TypeError: function takes exactly 8 arguments (9 given)

Then I tried putting the mask argument (0) first and tried the following script. But apparently the HEAD_LOOK vector is not updating, and I only get the vectors [0,0,1,0] over and over again.

import viz
viz.go()

headTrack = viz.addsensor('is600')
headTrack.command(11)
# Uses only 3 dof to prevent drifting of the scene
# To switch back to 6 dof use command(1)
handTrack = viz.addsensor('is600')
handTrack.command(11)

headView = viz.add(viz.VIEWPOINT)
headView.link(0,headTrack)

handView = viz.add(viz.VIEWPOINT)
handView.link(0,handTrack)

def test(t):
vect = headView.get(viz.HEAD_LOOK)
print 'headLook',vect
vect = handView.get(viz.HEAD_LOOK)
print 'handLook',vect
viz.starttimer(0,3)

viz.starttimer(0)
viz.callback(viz.TIMER_EVENT,'test')
Reply With Quote