Thread: moving locally
View Single Post
  #2  
Old 01-18-2011, 11:18 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
The example below links the hand to a keyboard tracker and keeps it in the reference frame of the main view:
Code:
import viz
viz.go()

import vizinfo
vizinfo.add("To move the hand use 'a/d' left/right, 'w/s' forward/back, 'r/f' up/down")

import viztracker
keyTracker = viztracker.KeyboardPos()

hand = viz.addAvatar('hand.cfg')
ground = viz.addChild('tut_ground.wrl')

link = viz.link(keyTracker,hand)
link.preTrans([0.2,0,1])
link.postMultLinkable(viz.MainView)
Reply With Quote