|
|
Thread Tools | Rate Thread | Display Modes |
#1
|
|||
|
|||
How to pass only 1 axis of the position signal from the source to the dest in a LINK?
Hi all,
I know that in a LINK, one can set the MASK of of the LINK to pass only the orientation, only the position, or both from the source node to the destination node. My question is whether there is a way to pass only one axis (e.g. only X axis) of the position signal from the source to the destination. In our case, the source is the head tracker and the destination is the viz.mainView. We want to pass the orientation signal and only the x axis of the position signal to the viz.mainView, so that the tracker signal won't affect the y position and the z position of the viz.mainView. Is there a simple way to do this? Thanks in advance! Zhi |
#2
|
|||
|
|||
Yes, you can get the position and orientation of the tracker each frame and apply whichever parts of that you want:
Code:
import viz import vizact import vizcam viz.go() dojo = viz.addChild('dojo.osgb') keyTracker = vizcam.addKeyboard6DOF() def updateView(): pos = keyTracker.getPosition() ori = keyTracker.getEuler() viz.MainView.setPosition([pos[0],1.8,0]) viz.MainView.setEuler(ori) vizact.onupdate(0,updateView) |
#3
|
|||
|
|||
Cool, Jeff. So I don't need to use LINK at all. Thank you for your suggestion. I will try that.
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
** ERROR: Link failed (source linkable is invalid) | mhead10 | Vizard | 2 | 10-04-2012 02:18 PM |
multiplication on link position matrix | Chapre | Vizard | 2 | 07-08-2011 02:55 AM |
Can you link the position of a tracker to the orientation of an object? | michaelrepucci | Vizard | 1 | 09-19-2008 11:23 AM |