WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-05-2013, 10:33 AM
Andy Andy is offline
Member
 
Join Date: Mar 2008
Location: Germany
Posts: 36
Link only one Axis

Hello,
I want to link the orientation of an mySensor with a node (box).
In my example I link the node with the MainView. Furthermore, I want to link the orientation of my sensor (src) with the node (dst) too. But not all axis, like in my example, I want to link only the orientation of the Y-axis of mySensor.
Is this possible?

Code:
import viz
viz.go()

box = viz.add('box.wrl', pos=[0,0,0])
plan = viz.add('tut_ground.wrl')

mySensor = viz.add( 'testtrack_all.dls' )

link = viz.link(viz.MainView, box, mask=viz.LINK_POS|viz.LINK_ORI)
link.postTrans([0,0,6])
viewLinkOp = link.preMultLinkable(mySensor, target=viz.LINK_ORI)
Reply With Quote
  #2  
Old 06-06-2013, 01:52 PM
Kevin Chiu Kevin Chiu is offline
WorldViz Team Member
 
Join Date: Feb 2012
Posts: 26
Hi Andy,

Is this the effect which you want?

Code:
import viz
viz.go()

box = viz.add('box.wrl', pos=[0,0,0])
plan = viz.add('tut_ground.wrl')

mySensor = viz.add( 'testtrack_all.dls' )

link = viz.link(mySensor, box, mask=viz.LINK_ORI)
link.preScale([1,0,0], target = viz.LINK_ORI_OP)
viewLink = viz.link(link, viz.MainView)
Reply With Quote
  #3  
Old 06-07-2013, 01:38 AM
Andy Andy is offline
Member
 
Join Date: Mar 2008
Location: Germany
Posts: 36
In part, now affected mySensor also on the MainView, that shouldnt‘ be. The orientation of mySensor (y-axis) should additional affected only on the linked box.
Any idea?
Reply With Quote
  #4  
Old 06-07-2013, 03:09 PM
Kevin Chiu Kevin Chiu is offline
WorldViz Team Member
 
Join Date: Feb 2012
Posts: 26
You can just comment out the last line of the script.
Reply With Quote
  #5  
Old 06-10-2013, 02:18 AM
Andy Andy is offline
Member
 
Join Date: Mar 2008
Location: Germany
Posts: 36
Yes I know but I want to link the MainView to the box node. The y orientation link of mySensor should be added like the ‘preMultLinkable’ function realize this.
Reply With Quote
  #6  
Old 06-13-2013, 02:01 AM
Andy Andy is offline
Member
 
Join Date: Mar 2008
Location: Germany
Posts: 36
Is there no solution for my problem?
- Filter a pre-multiply linkable operator so that only one axis of the pre-multiply-node takes an effect on the main link, like "target = viz.LINK_ORI_Y"
Reply With Quote
  #7  
Old 06-13-2013, 12:33 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
You want the position/pitch/roll of the box based on the viewpoint and the yaw of the box based on the sensor, correct?

If that's the case you could manually update the box orientation every frame in a function registered with vizact.onupdate:
Code:
import viz
import vizact
viz.go()

box = viz.add('box.wrl', pos=[0,0,0])
plan = viz.add('tut_ground.wrl')

mySensor = viz.add( 'testtrack_all.dls' )

link = viz.link(viz.MainView, box, mask=viz.LINK_POS)
link.postTrans([0,0,6])

def updateOri():
	yaw = mySensor.getEuler()[0]
	pitch = viz.MainView.getEuler()[1]
	roll = viz.MainView.getEuler()[2]
	box.setEuler([yaw,pitch,roll])
	
vizact.onupdate(0,updateOri)
Reply With Quote
  #8  
Old 06-18-2013, 03:30 AM
Andy Andy is offline
Member
 
Join Date: Mar 2008
Location: Germany
Posts: 36
Thanks it works
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
How to pass only 1 axis of the position signal from the source to the dest in a LINK? Zhi Vizard 2 04-04-2013 08:28 AM
How can I link MainView with HMD and a 3d node? Salvar Vizard 5 03-22-2011 09:14 PM
Link MainView to instable platform sleiN13 Vizard 2 01-10-2011 01:33 AM
Remove link and have object drop/collide? cgibb Vizard 6 03-02-2010 05:18 PM
Object rotating around world axis, not own axis tacbob Vizard 1 02-15-2007 10:12 AM


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


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