WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-01-2014, 10:08 AM
shivanangel shivanangel is offline
Member
 
Join Date: Feb 2006
Location: New Jersey
Posts: 182
Question Transforms, Nodes and Links

Moved from Vizard 4 forums to 5 since this my questions have gravitated toward the new <node3d>.getTransform().

I have a hierarchical object that I have grabbed a transform from, in this case a shelf. I use the transform to move the shelf in and out using vizact.

I have a series of containers I want to place on the shelf, my prior instincts would have me parent the objects to the shelf so they move when the shelf comes out. However, the link object returned by getTransform does not support this.

How do I go about linking these objects in a smart (easy) way?
For instance, I also want to be able to offset the objects from one another (tradiditonally using <node3d>.setPosition).

But if I use viz.link( shelf, container1) I have to apply the offset to the link using <link>.offset(), meaning I now need to store these links for retrieval later if I choose to break it.

Is there a better way to do this in Vizard 5 that I am missing? Some way to insert an object under the link returned by getTransform?
Attached Thumbnails
Click image for larger version

Name:	Parenting.png
Views:	731
Size:	38.2 KB
ID:	643  
Reply With Quote
  #2  
Old 06-04-2014, 08:43 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
You could try linking a group node to the transform and then parenting all the objects to that group node.
Reply With Quote
  #3  
Old 06-13-2014, 04:13 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
I'm not sure I exactly understand what you are trying to accomplish, but you can use the optional node parameter of <node>.setParent to parent an object to the sub-transform node:
Code:
# Get transform handle from model
xform = model.getTransform('name')

# Parent child under transform of model
child.setParent(model, node='name')
Reply With Quote
Reply

Tags
gettranform

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 09:09 AM.


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