Class SphereVBO.VBOSphereMeshBuilder

java.lang.Object
org.jzy3d.plot3d.primitives.vbo.drawable.SphereVBO.VBOSphereMeshBuilder
All Implemented Interfaces:
IGLLoader<DrawableVBO>
Enclosing class:
SphereVBO

public static class SphereVBO.VBOSphereMeshBuilder extends Object implements IGLLoader<DrawableVBO>
This load the definition of a VBO sphere object and set arrays for later rendering.
Author:
David Eck inspired this class with https://math.hws.edu/graphicsbook/source/jogl/ColorCubeOfSpheres.java, Martin Pernollet
  • Field Details

    • sphereVertexBuffer

      protected FloatBuffer sphereVertexBuffer
    • sphereNormalBuffer

      protected FloatBuffer sphereNormalBuffer
    • sphereVertexArray

      protected float[] sphereVertexArray
    • vertexVboId

      protected int vertexVboId
    • normalVboId

      protected int normalVboId
    • hasMountedOnce

      protected boolean hasMountedOnce
    • vboIds

      protected Map<IPainter,int[]> vboIds
      VBO identifiers (vertex, normal) for each painter : a builder is shared by all spheres having the same geometry, which may be rendered by different charts, hence in different GL contexts.
  • Constructor Details

    • VBOSphereMeshBuilder

      public VBOSphereMeshBuilder(double radius, int stacks, int slices)
  • Method Details

    • load

      public void load(IPainter painter, DrawableVBO drawable) throws Exception
      Specified by:
      load in interface IGLLoader<DrawableVBO>
      Throws:
      Exception
    • hasMountedOnce

      public boolean hasMountedOnce()
    • hasMountedOnce

      public boolean hasMountedOnce(IPainter painter)
      True if the VBOs have been loaded in the GL context of this painter.
    • getVboIds

      public int[] getVboIds(IPainter painter)
      The vertex and normal VBO identifiers in the GL context of this painter, or null.