Use geometry factories
As described in this document, jReality provides a variety of subclasses of de.jreality.scene.Geometry for representing geometric objects. The most widely used are PointSet, IndexedLineSet, and IndexedFaceSet. Because these are so widely used, and because the underlying data representation can be difficult to understand, jReality offers factories which hide the complexity of these classes, while offering convenient methods for setting the attributes.
All the geometry factories in jReality share the following features:
- Each instance of a factory corresponds to a single instance of a Geometry.
- Each factory is only guaranteed to be up-to-date after calling update().
- There are two types of set methods:
- Methods which sets vertex/edge/face attribute data directly,
- Methods which direct the factory to generate some vertex/edge/face attribute data automatically.
- There is a single get...() method which returns the instance of the geometry produced by the factory.