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-
invalid @link
NormalMode.REPEATED
-
invalid @link
NormalMode.SHARED
- A normal array can be provided externally to rely on other algorithms.
- If neither
Normal.NormalMode
neither 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
Modifier and TypeFieldDescriptionprotected float[]
protected IColorMap
protected boolean
protected int[]
protected int[][]
protected int[]
protected int[]
protected static org.apache.logging.log4j.Logger
protected Normal.NormalMode
protected float[]
protected int
protected float[]
protected int
Fields inherited from class org.jzy3d.plot3d.primitives.vbo.drawable.loaders.VBOBufferLoader
verifyUniquePoints
-
Constructor Summary
ConstructorDescriptionVBOBufferLoaderForArrays
(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 TypeMethodDescriptionvoid
load
(IPainter painter, DrawableVBO2 drawable) protected void
verifyColorBufferSizeConsistency
(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:
load
in interfaceIGLLoader<DrawableVBO2>
- Throws:
Exception
-
verifyColorBufferSizeConsistency
protected void verifyColorBufferSizeConsistency(DrawableVBO2 drawable, FloatBuffer verticeBuffer, FloatBuffer colorBuffer)
-