Class VBOBufferLoaderForArrays
java.lang.Object
org.jzy3d.plot3d.primitives.vbo.drawable.loaders.VBOBufferLoader
org.jzy3d.plot3d.primitives.vbo.drawable.loaders.VBOBufferLoaderForArrays
- All Implemented Interfaces:
IGLLoader<DrawableVBO2>
A utility class to build buffers to feed a
DrawableVBO2. Reading VBO javadoc may be
helpful as well
Not all parameters are mandatory, so we depict the effect of providing or not some of them.
Points
This holds the x,y,z coordinates and is mandatory.Colors
The loader can be given- A non null colormap with null colors array
- A non null color array with null colormap
- None of the above, in that case, the color will uniform to the whole drawable
- If both colormap and colors are given, an exception is thrown.
Normals
Normals allow processing light. There are four modes-
lead to autonomous processing of normals where each polygon get a single normal processed for the whole geometry (but the normal is repeated for each point).
invalid @link
NormalMode.REPEATED -
lead to autonomous processing of normals where each point get a normal processed as the average normal of all the polygons it belongs to.
invalid @link
NormalMode.SHARED - A normal array can be provided externally to rely on other algorithms.
- If neither
Normal.NormalModeneither a normal array are provided, no normal is will be buffered in the VBO.
DrawableVBO2.setComputeNormals(boolean) to
false. In that case, the result looks like :
Elements
Elements are optional and are used to avoid repeating intput points. In that case, geometries are defined by the indices and the point they refer to.- Author:
- Martin Pernollet
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected float[]protected IColorMapprotected booleanprotected int[]protected int[][]protected int[]protected int[]protected static org.apache.logging.log4j.Loggerprotected Normal.NormalModeprotected float[]protected intprotected float[]protected intFields inherited from class org.jzy3d.plot3d.primitives.vbo.drawable.loaders.VBOBufferLoader
verifyUniquePoints -
Constructor Summary
ConstructorsConstructorDescriptionVBOBufferLoaderForArrays(float[] points, int pointDimensions, int[][] elementIndices, IColorMap colormap, float[] coloring, float[] normals) VBOBufferLoaderForArrays(float[] points, int pointDimensions, int[][] elementIndices, IColorMap colormap, float[] coloring, Normal.NormalMode normalMode) VBOBufferLoaderForArrays(float[] points, int pointDimensions, int[] elementStarts, int[] elementLength, IColorMap colormap, float[] coloring, Normal.NormalMode normalMode) VBOBufferLoaderForArrays(float[] points, int pointDimensions, int[] geometries, int verticesPerGeometry, IColorMap colormap, float[] coloring, Normal.NormalMode normalMode) -
Method Summary
Modifier and TypeMethodDescriptionvoidload(IPainter painter, DrawableVBO2 drawable) protected voidverifyColorBufferSizeConsistency(DrawableVBO2 drawable, FloatBuffer verticeBuffer, FloatBuffer colorBuffer) Methods inherited from class org.jzy3d.plot3d.primitives.vbo.drawable.loaders.VBOBufferLoader
computeAverageNormalsForEachVertex, computeSharedNormals, computeSharedNormals, computeSimpleNormals, isVerifyUniquePoints, loadColorBufferFromArray, loadColorBufferFromColormap, loadNormalsFromArray, loadVerticesFromArray, setVerifyUniquePoints, verifyDoublons
-
Field Details
-
log
protected static org.apache.logging.log4j.Logger log -
points
protected float[] points -
pointDimensions
protected int pointDimensions -
normals
protected float[] normals -
elements
protected int[] elements -
verticesPerGeometry
protected int verticesPerGeometry -
elementsStarts
protected int[] elementsStarts -
elementsLength
protected int[] elementsLength -
elementsIndices
protected int[][] elementsIndices -
colormap
-
coloring
protected float[] coloring -
normalMode
-
debug
protected boolean debug
-
-
Constructor Details
-
VBOBufferLoaderForArrays
public VBOBufferLoaderForArrays(float[] points, int pointDimensions, int[] elementStarts, int[] elementLength, IColorMap colormap, float[] coloring, Normal.NormalMode normalMode) -
VBOBufferLoaderForArrays
public VBOBufferLoaderForArrays(float[] points, int pointDimensions, int[][] elementIndices, IColorMap colormap, float[] coloring, Normal.NormalMode normalMode) -
VBOBufferLoaderForArrays
public VBOBufferLoaderForArrays(float[] points, int pointDimensions, int[][] elementIndices, IColorMap colormap, float[] coloring, float[] normals) -
VBOBufferLoaderForArrays
public VBOBufferLoaderForArrays(float[] points, int pointDimensions, int[] geometries, int verticesPerGeometry, IColorMap colormap, float[] coloring, Normal.NormalMode normalMode)
-
-
Method Details
-
load
- Specified by:
loadin interfaceIGLLoader<DrawableVBO2>- Throws:
Exception
-
verifyColorBufferSizeConsistency
protected void verifyColorBufferSizeConsistency(DrawableVBO2 drawable, FloatBuffer verticeBuffer, FloatBuffer colorBuffer)
-