WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1  
Old 04-03-2008, 10:21 AM
Elittdogg Elittdogg is offline
Member
 
Join Date: Aug 2007
Posts: 77
Another point of interest:

I tried just creating a blank script with the letters and here's what I have:

import viz
viz.go()

A = viz.add(viz.TEXT3D,'A', viz.RELATIVE_LOCAL)
A.translate(.17,.985,4.2)
A.color(1,0,0)
A.scale(.2, .2, 2)

H = viz.add(viz.TEXT3D,'H', viz.RELATIVE_LOCAL)
H.translate(0,.95,4.2)
H.color(0,0,1)
H.scale(.2, .2, 2)

I = viz.add(viz.TEXT3D, 'I', viz.RELATIVE_LOCAL)
I.translate(0,.80,4.2)
I.color(0,1,0)
I.scale(.2,.2,.2)

Now in this case, I can get H and A to appear but not I. And I've added others like Q and R and they won't appear either. Is there some limit to how many I can add? And if this is true then why in my actual script (where I need the letters to appear) won't A or H or I appear at all!!??? What's going on?
Reply With Quote
  #2  
Old 04-03-2008, 10:42 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
You need to remove the viz.RELATIVE_LOCAL from the viz.add command. When adding text the 3rd parameter is the parent the text should be attached to. By default it is viz.WORLD. If you want to attach some text to an existing object try the following example:
Code:
import viz
viz.go()

box = viz.add('box.wrl')
box.add(vizact.spin(0,1,0,90,viz.FOREVER))
box.translate(0,1,5)

#Add text as child of box
A = viz.add(viz.TEXT3D,'A', box)
A.alignment(viz.TEXT_CENTER_CENTER)

#Text translation will be relative to boxes local coordinate system
A.translate(0,.985,0)
A.color(0,0,0)
A.scale(.2, .2, 2)

viz.clearcolor(viz.GRAY)
All text object transformations (translate,rotate,scale) will now be relative to the local coordinate system of the box.

In your case, are the boxes static or will they be moving around? If the boxes are static, then you don't need set the parent of the text. Just add the text to viz.WORLD and place it where the boxes are. If the boxes will be moving around then add the text as children of the boxes and position the text locally, relative to the box.
Reply With Quote
  #3  
Old 04-08-2008, 02:15 PM
Elittdogg Elittdogg is offline
Member
 
Join Date: Aug 2007
Posts: 77
thank you for the help. I got it figured out now
Reply With Quote
Reply


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
retrieve Object names Geoffrey Vizard 11 12-11-2009 04:26 AM
Child Object Rotation paulgoldberg Vizard 5 09-05-2006 11:33 AM
adding 2D text via script V.shazzle Vizard 3 09-19-2005 02:45 PM
rotate to object jargon Vizard 1 08-08-2005 12:20 PM
3d Text with Transparent Borders vjosh Vizard 3 12-01-2004 10:50 AM


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


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