Class BaseText

java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.text.BaseText
All Implemented Interfaces:
VRMLNode, FrameStateListener, VRMLGeometryNodeType, VRMLNodeType, VRMLTextNodeType
Direct Known Subclasses:
NRText, OGLText

public abstract class BaseText extends AbstractNode implements VRMLTextNodeType

Common base implementation of a Text node.

This base class provides a number of convenience methods for generating the visible text. It is not required that the derived implementation make use of them, but it assumes that you know when you create the class whether you will need them or not.

Text generation is provided by a texture that is an alpha mask over the stock texture and geometry. VRML requires that a text object be fully textured using the normal appearance node information, so this is just used as an alpha mask to control what geometry is actually visible.

The texture generation does not do the full rendering of the text. It assumes that the derived class will also contribute to the process by playing with texture coordinates. The following fields from the FontStyle require the derived class to do something.

  • leftToRight: If set to FALSE, then reverse the texture coordinates to render in the mirror image.
The image generated is drawn from the bottom of the image upwards, rather that from the top (0, 0 in image coordinates). This is so that texture coordinates look sane and you can take the right part of the image as needed without any extra calculation.

Properties

The following properties are used by this class

  • org.web3d.vrml.nodes.fontstyle.font.antialiased Boolean to indicate the rendering should use antialiased text rather than normal rendering. The default is false.
Version:
$Revision: 1.28 $
Author:
Justin Couch