Adding text to ObjectContainer3D

Software: Away3D 4.x

kochumvk, Newbie
Posted: 14 September 2012 05:48 AM   Total Posts: 17

Hi Experts,

Please help me with adding text on ObjectContainer3D. I am trying to label few things, for example I need to add some text over a cube(on 2 sides of cube), What is the ideal method to achieve this in away3D 4?

   

Richard Olsson, Administrator
Posted: 14 September 2012 06:10 AM   Total Posts: 1192   [ # 1 ]

Use a regular Flash TextField and draw it to a BitmapData. Then use that BitmapData as a texture on your 3D object, either directly on the cube or on a plane near the cube, depending on what suits your application best.

Make sure that the dimensions of the BitmapData are powers of two, e.g. 128x64 (or even square, 128x128.) The simplest thing is for the text field to fill the entire bitmap data, and to then use the original text field dimensions for the plane. Achieve this by using a matrix when you draw to the bitmap data.

 

   

kochumvk, Newbie
Posted: 14 September 2012 10:02 AM   Total Posts: 17   [ # 2 ]
Richard Olsson - 14 September 2012 06:10 AM

Use a regular Flash TextField and draw it to a BitmapData. Then use that BitmapData as a texture on your 3D object, either directly on the cube or on a plane near the cube, depending on what suits your application best.

Make sure that the dimensions of the BitmapData are powers of two, e.g. 128x64 (or even square, 128x128.) The simplest thing is for the text field to fill the entire bitmap data, and to then use the original text field dimensions for the plane. Achieve this by using a matrix when you draw to the bitmap data.

Thanks Olsson, I got it. However I have made my text as image in Photoshop since its static text and loaded it. a 3 x 2 matrix did the trick pretty easily.
But its sad that we can’t have vector text (that’s asking too much, I know:))

My result is attached

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X