PDA

View Full Version : How to reverse link direction


Jerry
10-12-2007, 12:46 PM
I have an inertiacube linked to a model using the following code:


ori = add('intersense.dls')
orilink = link(ori,model)


How can I reverse the sign of the pitch so that when I tilt top of the
inertiacube away from me the top of the model rotates toward me?
I want the yaw and roll to remain unchanged.

farshizzo
10-12-2007, 03:29 PM
There is no built-in link operator that can perform this inversion. However, the following code should work:def InvertPitch(n):
euler = n.getEuler()
euler[1] = -euler[1]
n.setEuler(euler)
vizact.onupdate(viz.PRIORITY_LINKS+1,InvertPitch,n ode)