WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-03-2013, 11:20 AM
Zhi Zhi is offline
Member
 
Join Date: Mar 2011
Posts: 49
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
Reply With Quote
  #2  
Old 04-03-2013, 03:37 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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)
Reply With Quote
  #3  
Old 04-04-2013, 07:28 AM
Zhi Zhi is offline
Member
 
Join Date: Mar 2011
Posts: 49
Cool, Jeff. So I don't need to use LINK at all. Thank you for your suggestion. I will try that.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
** ERROR: Link failed (source linkable is invalid) mhead10 Vizard 2 10-04-2012 01:18 PM
multiplication on link position matrix Chapre Vizard 2 07-08-2011 01:55 AM
Can you link the position of a tracker to the orientation of an object? michaelrepucci Vizard 1 09-19-2008 10:23 AM


All times are GMT -7. The time now is 05:21 PM.


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