< Zurück | Inhalt | Weiter >

8.6 Text3D

java.lang.Object

|

+−−javax.media.j3d.SceneGraphObject

|

+−−javax.media.j3d.NodeComponent

|

+−−javax.media.j3d.Geometry

|

+−−javax.media.j3d.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.


image


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

object.


 

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