< Zurück | Inhalt | Weiter >

8.6 Text3D










The Text3D class generates 3D geometry for a given font, with a given extrusion, as shown in figure 8.11. In contrast to the Text2D class, which merely generates an image of the text string in a given font, Text3D creates a true complex 3D object that forms the text string supplied. The font and pitch describe the generated geometry in the X and Y dimensions, whereas a FontExtrusion object describes the font in the Z direction.


Figure 8.11 A Text3D instance rendered as a wireframe

Although Text3D is relatively straightforward to use, it is often more of a problem, in applications that use Text3D objects as labels, to ensure that the Text3D object is always aligned relative to the viewer so as to be easily visible.

The following example creates a simple 10−point SansSerif 3D−text label and encapsulates it in a Shape3D



From BillboardTest.java (see also Text3DTest.java)
From Text3DTest.java
8.6.2 SetString problems