WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-12-2007, 12:46 PM
Jerry Jerry is offline
Member
 
Join Date: Jun 2004
Posts: 105
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.
Reply With Quote
  #2  
Old 10-12-2007, 03:29 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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)
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:46 AM.


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