Class SphereVBO
java.lang.Object
org.jzy3d.plot3d.primitives.Drawable
org.jzy3d.plot3d.primitives.vbo.drawable.DrawableVBO
org.jzy3d.plot3d.primitives.vbo.drawable.SphereVBO
- All Implemented Interfaces:
IGLBindedResource
,IGLRenderer
,ISortableDraw
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:
- David Eck inspired this class with https://math.hws.edu/graphicsbook/source/jogl/ColorCubeOfSpheres.java, Martin Pernollet
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
This load the definition of a VBO sphere object and set arrays for later rendering. -
Field Summary
Modifier and TypeFieldDescriptionprotected static Map<SphereVBO.SphereKey,
SphereVBO.VBOSphereMeshBuilder> Fields inherited from class org.jzy3d.plot3d.primitives.vbo.drawable.DrawableVBO
arrayName, byteOffset, color, colorChannelNumber, dimensions, elementName, geometry, hasMountedOnce, loader, normalOffset, pointer, polygonMode, polygonOffsetFactor, polygonOffsetFillEnable, polygonOffsetUnit, quality, size, width
Fields inherited from class org.jzy3d.plot3d.primitives.Drawable
bbox, boundingBoxColor, boundingBoxDisplayed, displayed, hasListeners, legend, legendDisplayed, listeners, spaceTransformer, transform, transformBefore
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Call OpenGL2 routines for rendering the object.protected void
drawSphereDirectWithDataFromArrays
(com.jogamp.opengl.GL2 gl) protected void
drawSphereWithDrawArrays
(com.jogamp.opengl.GL2 gl, int slices, int stacks) Draw one sphere.getBuilder
(double radius, int stacks, int slices) Allows retrieving or creating a sphere builder for this combination of parameters.void
Mount resources to gl contextvoid
Methods inherited from class org.jzy3d.plot3d.primitives.vbo.drawable.DrawableVBO
applyGeometryTransform, applyPolygonModeFillGL2, applyQuality, applyVertices, applyWidth, color, configure, disable, disableColor, doBindGL2, doConfigure, doConfigure, doDrawElements, doLoadArrayFloatBuffer, doLoadArrayFloatBuffer, doLoadElementIntBuffer, doLoadElementIntBuffer, doSetBoundingBox, enable, getColor, getGeometry, getPolygonMode, getPolygonOffsetFactor, getPolygonOffsetUnit, getQuality, getWidth, hasMountedOnce, isHasColorBuffer, isPolygonOffsetFillEnable, pointers, polygonOffseFillEnable, polygonOffsetFillDisable, rotator, rotator, rotator, setColor, setData, setData, setData, setGeometry, setHasColorBuffer, setPolygonMode, setPolygonOffsetFactor, setPolygonOffsetFillEnable, setPolygonOffsetUnit, setQuality, setWidth
Methods inherited from class org.jzy3d.plot3d.primitives.Drawable
addDrawableListener, asWireframeable, dispose, doDrawBoundsIfDisplayed, doTransform, fireDrawableChanged, fireDrawableChanged, getBarycentre, getBoundingBoxColor, getBounds, getDistance, getLegend, getLongestDistance, getShortestDistance, getSpaceTransformer, getTransform, getTransformBefore, hasLegend, isBoundingBoxDisplayed, isDisplayed, isLegendDisplayed, removeDrawableListener, setBoundingBoxColor, setBoundingBoxDisplayed, setDisplayed, setLegend, setLegendDisplayed, setSpaceTransformer, setTransform, setTransformBefore, toString, toString
-
Field Details
-
builders
-
-
Constructor Details
-
SphereVBO
-
-
Method Details
-
updateBounds
public void updateBounds()- Overrides:
updateBounds
in classDrawableVBO
-
mount
Description copied from interface:IGLBindedResource
Mount resources to gl context- Specified by:
mount
in interfaceIGLBindedResource
- Overrides:
mount
in classDrawableVBO
-
draw
Description copied from class:Drawable
Call OpenGL2 routines for rendering the object.- Specified by:
draw
in interfaceIGLRenderer
- Overrides:
draw
in classDrawableVBO
-
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
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 radiusstacks
- number of latitudesslices
- number of longitudes- Returns:
-