Class VBOBufferLoader
java.lang.Object
org.jzy3d.plot3d.primitives.vbo.drawable.loaders.VBOBufferLoader
- Direct Known Subclasses:
VBOBufferLoaderForArrays,VBOBufferLoaderForPolygons,VBOBufferLoaderForPolygonsPrimitiveRestart
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected FloatBuffercomputeAverageNormalsForEachVertex(List<Coord3d> verticeList, com.google.common.collect.ArrayListMultimap<Coord3d, Coord3d> vertexNormals) Process the average normal of a points, based on parametervertexNormalspoint is mapped to a list of all normals of all polygons that have this point in common.computeSharedNormals(int[][] elementIndices, List<Coord3d> verticeList) computeSharedNormals(int[] geometries, int geometrySize, List<Coord3d> verticeList) When vertices are shared between multiple triangles, each vertex normal should be unique and computed out of all triangles that share the vertex.computeSimpleNormals(int pointsPerGeometry, List<Coord3d> verticeList) booleanloadColorBufferFromArray(float[] coloring) loadColorBufferFromColormap(List<Coord3d> verticeList, BoundingBox3d bounds, int colorChannels, IColorMap colormap) loadNormalsFromArray(float[] points) loadVerticesFromArray(float[] points, int pointDimensions, List<Coord3d> verticeList, BoundingBox3d bounds) voidsetVerifyUniquePoints(boolean verifyUniquePoints) protected voidverifyDoublons(List<Coord3d> verticeList)
-
Field Details
-
verifyUniquePoints
protected boolean verifyUniquePoints
-
-
Constructor Details
-
VBOBufferLoader
public VBOBufferLoader()
-
-
Method Details
-
loadVerticesFromArray
public FloatBuffer loadVerticesFromArray(float[] points, int pointDimensions, List<Coord3d> verticeList, BoundingBox3d bounds) -
loadColorBufferFromArray
-
loadColorBufferFromColormap
public FloatBuffer loadColorBufferFromColormap(List<Coord3d> verticeList, BoundingBox3d bounds, int colorChannels, IColorMap colormap) -
loadNormalsFromArray
-
computeSimpleNormals
- Parameters:
pointsPerGeometry- 3 for a triangle, N for a triangle fan, 4 for a pseudo quad (a 2 triangle fans)verticeList-- Returns:
-
computeAverageNormalsForEachVertex
protected FloatBuffer computeAverageNormalsForEachVertex(List<Coord3d> verticeList, com.google.common.collect.ArrayListMultimap<Coord3d, Coord3d> vertexNormals) Process the average normal of a points, based on parametervertexNormalspoint is mapped to a list of all normals of all polygons that have this point in common.- Parameters:
verticeList- provides all vertices in the order they are sent to the GPU via the VBO. Listis easier to process than the original vertex FloatBuffer vertexNormals- associate coordinate -> invalid input: '<'normal1, normal2, ... normalN>.- Returns:
- a buffer of average normals of the same size of the vertex buffer that was built at the same time than verticeList
-
verifyDoublons
-
isVerifyUniquePoints
public boolean isVerifyUniquePoints() -
setVerifyUniquePoints
public void setVerifyUniquePoints(boolean verifyUniquePoints)
-