|
#1
|
|||
|
|||
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? |
#2
|
|||
|
|||
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) 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. |
#3
|
|||
|
|||
thank you for the help. I got it figured out now
|
|
|
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 |