Class SphereVBO

  • All Implemented Interfaces:
    IGLBindedResource, IGLRenderer, ISortableDraw

    public class SphereVBO
    extends DrawableVBO
    Warning! Observed that the sphere will render weirdly for rare viewpoint when following GL setting is applied. gl.glDisable(GL.GL_DEPTH_TEST) This is true when Quality.setAlphaActivated(false), in other word for Quality.Advanced.
    Author:
    Martin Pernollet
    • Constructor Detail

      • SphereVBO

        public SphereVBO​(Coord3d position,
                         float radius,
                         int stacks,
                         int slices,
                         Color color)
    • Method Detail

      • drawSphereDirectWithDataFromArrays

        protected void drawSphereDirectWithDataFromArrays​(com.jogamp.opengl.GL2 gl)
      • drawSphereWithDrawArrays

        protected void drawSphereWithDrawArrays​(com.jogamp.opengl.GL2 gl,
                                                int slices,
                                                int stacks)
        Draw one sphere. The VertexPointer and NormalPointer must already be set to point to the data for the sphere, and they must be enabled.
      • getBuilder

        public static SphereVBO.VBOSphereMeshBuilder getBuilder​(double radius,
                                                                int stacks,
                                                                int slices)
        Allows retrieving or creating a sphere builder for this combination of parameters. The goal is to share a common mesh definition - hence a single pair of array - for a sphere parameter combination.
        Parameters:
        radius - sphere radius
        stacks - number of latitudes
        slices - number of longitudes
        Returns: