PDA

View Full Version : Can you link the position of a tracker to the orientation of an object?


michaelrepucci
09-19-2008, 09:58 AM
I love the fact that you can link a sensor to an object, saving the pain and computational time of writing a callback on every frame that does the same thing. But how flexible is the link? I would like the the rotation of an object (specifically the yaw) to be linked to the position of a head-tracker (specifically the X-Z position relative to the object). Is there a simple way to do this, or do I need to use code like:

viz.callback(viz.UPDATE_EVENT,onUpdate)
def onUpdate(event):
pos = tracker.getPosition()
object.setEuler(someFunction(pos),0,0)

For that matter, would this be the best way to code this in Vizard, assuming there's no simple linking solution?

farshizzo
09-19-2008, 10:23 AM
The link objects support basic transformations on the incoming data. If you need to perform some custom calculation on the data then you have to manually do it per frame, as you have already done.