WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-23-2010, 05:50 AM
knightgba knightgba is offline
Member
 
Join Date: Jul 2010
Posts: 8
How to move a text object and its children text objects as a whole

Just like the hierarchical models example carousel in the viz tutorial in which case the object is 3d model not text object.

a matrix translation?
Reply With Quote
  #2  
Old 08-23-2010, 07:33 AM
knightgba knightgba is offline
Member
 
Join Date: Jul 2010
Posts: 8
ok...Think I can do this manually.
Ob = viz.addText('text')
Ob = setPosition(x,y,z)
ChildrenofOb = viz.addText('Children Text')
ChildrenofOb = setPosition(a,b,c)

Action = vizact.moveTo([x1,y1,z1])
ChildrenAction = vizact.moveTo(a+(x1-x), b+(y1-y), c+(z1-z))

Ob.actAction(Action)
ChildrenofOb.actAction(ChildrenAction)
Reply With Quote
  #3  
Old 08-24-2010, 10:21 AM
masaki masaki is offline
Member
 
Join Date: Jan 2008
Posts: 63
Hi,

I'm not 100% sure what you're trying to accomplish but here is an example of a two text object hierarchy. text1 is parented to the groupNode and text2 is a child of text1. They have actions applied to them independently but they spin/move in their parents coordinate system.

Best,
Masaki

Code:
import viz
viz.go()

groupNode = viz.addGroup()

text1 = viz.addText( 'Parent',pos=(0,3,5), parent=groupNode )
text2 = viz.addText( 'Child',  pos=(0,-1,0), parent=text1 )

spin = vizact.spin( 0,45,0,speed=45 )
text1.addAction( spin )

move = vizact.sequence( [vizact.move([0,1,0],.5), vizact.move(0,-1,0,.5)], viz.FOREVER)
text2.addAction( move )
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 12:05 PM.


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