public class CubeUnwrapped extends Object
A geometry in the jReality scene graph does not allow per face vertex attributes. So to unwrap a geometry e.g. to put a texture on it, one has to introduce multiple vertices. The IndexedFaceSetFactory supports this as follows: set vertex coordinates for all vertices (setVertexCount(), setVertexCoordinates()), set the face indices to the wrapped faces (leave out the extra vertices) (setFaceCount(), setFaceIndices), and use setUnwrapFaceIndices(int[][]) or its variants to introduce the unwrapped faces (same number of faces).
The unwrapFaceIndices are written into the created IndexedFaceSet. The faceIndices are used to generate attributes, in particular to generate correct vertex normals. The vertices that represent the same vertex are detected from correspondence in faceIndices and unwrapFaceIndices, and not from the vertex coordinates. See also the tutorial.
Constructor and Description |
---|
CubeUnwrapped() |
public static void main(String[] args)