de.jreality.tutorial.geom
Class CubeUnwrapped
java.lang.Object
de.jreality.tutorial.geom.CubeUnwrapped
public class CubeUnwrapped
- extends java.lang.Object
Tutorial on uwrapping a geometry using IndexedFaceSetFactory.
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.
- Author:
- G. Paul Peters, 11.04.2009
Method Summary |
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CubeUnwrapped
public CubeUnwrapped()
main
public static void main(java.lang.String[] args)