WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   How to reverse link direction (https://forum.worldviz.com/showthread.php?t=1238)

Jerry 10-12-2007 12:46 PM

How to reverse link direction
 
I have an inertiacube linked to a model using the following code:

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:
Code:

def InvertPitch(n):
        euler = n.getEuler()
        euler[1] = -euler[1]
        n.setEuler(euler)
vizact.onupdate(viz.PRIORITY_LINKS+1,InvertPitch,node)



All times are GMT -7. The time now is 04:38 AM.

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