Exploring a Papervision3D class – Text3D
December 13th, 2008
Hi:
As some of you may know VectorVision (vector fonts in flash) was added into Papervision3D last week so I decided to check out the new typography package. To my surprise, it was fairly simple to set up. This is a small example.
package
{
import flash.events.Event;
import org.papervision3d.materials.special.Letter3DMaterial;
import org.papervision3d.typography.Font3D;
import org.papervision3d.typography.Text3D;
import org.papervision3d.typography.fonts.HelveticaRoman;
import org.papervision3d.view.BasicView;
public class SampleText3D extends BasicView
{
private var text3D:Text3D;
private var textMaterial:Letter3DMaterial;
private var font3D:Font3D;
public function SampleText3D()
{
initialize();
startRendering();
}
private function initialize():void
{
textMaterial = new Letter3DMaterial(0x00FFFF);
font3D = new HelveticaRoman();
text3D = new Text3D("Hello there.", font3D, textMaterial);
text3D.scale = 2;
scene.addChild(text3D);
}
override protected function onRenderTick(event:Event = null):void
{
super.onRenderTick(event);
text3D.yaw(0.5);
text3D.roll(0.5);
}
}
}
{
import flash.events.Event;
import org.papervision3d.materials.special.Letter3DMaterial;
import org.papervision3d.typography.Font3D;
import org.papervision3d.typography.Text3D;
import org.papervision3d.typography.fonts.HelveticaRoman;
import org.papervision3d.view.BasicView;
public class SampleText3D extends BasicView
{
private var text3D:Text3D;
private var textMaterial:Letter3DMaterial;
private var font3D:Font3D;
public function SampleText3D()
{
initialize();
startRendering();
}
private function initialize():void
{
textMaterial = new Letter3DMaterial(0x00FFFF);
font3D = new HelveticaRoman();
text3D = new Text3D("Hello there.", font3D, textMaterial);
text3D.scale = 2;
scene.addChild(text3D);
}
override protected function onRenderTick(event:Event = null):void
{
super.onRenderTick(event);
text3D.yaw(0.5);
text3D.roll(0.5);
}
}
}

I see that there are only 5 fonts for Font3D (HelveticaBold, HelveticaLight, HelveticaMedium, HelveticaRoman). Do you know if there might be other fonts available for Fond3D, maybe as external library.
Do you know maybe why the back side of text is invisible once it rotates? It is not visible in your example as it never flips all the way around. Also, is there an easy way to extrude the text vector shape to give it depth?
is it somehow possible to apply the bend modifier to a Text3D object or is there some kind of workaround that lets you bend vectorvision 3d text?
i found this example, where the bend modifier is applied to a SvgPathsPapervision object: http://www.lamberta.org/blog/better-bend-than-break/ but i just can’t get it to work with the Text3D object.
@Colbert Philippe: the guy who made five3d (on which vectorvision is based on afaik) also made a tool, which generates the required actionscript from font-files. you can download it here: http://five3d.mathieu-badimon.com/ (make a new typography file v2.0)
@Colbert:
check out http://five3d.mathieu-badimon.com/ “make a new typography file” after the file is created, you just have to do some minor modifications, just compare the file with the already existing files
@jebac:
var material:Letter3DMaterial = new Letter3DMaterial(0xffffff);
material.doubleSided = true;
I am using HelveticaBold font for my Text3D. I need to reduce the font size. Can any one help me out. I have no idea of doing the same.
Thanks for ur help.
@Gemo
Use the scale property of the text3d