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
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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSphereVBO.SphereKeystatic classSphereVBO.VBOSphereMeshBuilderThis load the definition of a VBO sphere object and set arrays for later rendering.
-
Field Summary
Fields Modifier and Type Field Description protected static Map<SphereVBO.SphereKey,SphereVBO.VBOSphereMeshBuilder>builders-
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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddraw(IPainter painter)Call OpenGL2 routines for rendering the object.protected voiddrawSphereDirectWithDataFromArrays(com.jogamp.opengl.GL2 gl)protected voiddrawSphereWithDrawArrays(com.jogamp.opengl.GL2 gl, int slices, int stacks)Draw one sphere.static SphereVBO.VBOSphereMeshBuildergetBuilder(double radius, int stacks, int slices)Allows retrieving or creating a sphere builder for this combination of parameters.voidmount(IPainter painter)Mount resources to gl contextvoidupdateBounds()-
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, dispose, doDrawBoundsIfDisplayed, doTransform, fireDrawableChanged, fireDrawableChanged, getBarycentre, getBoundingBoxColor, getBounds, getDistance, getLegend, getLongestDistance, getShortestDistance, getSpaceTransformer, getTransform, getTransformBefore, hasLegend, isBoundingBoxDisplayed, isDisplayed, isLegendDisplayed, negative, removeDrawableListener, setBoundingBoxColor, setBoundingBoxDisplayed, setDisplayed, setLegend, setLegendDisplayed, setSpaceTransformer, setTransform, setTransformBefore, toString, toString
-
-
-
-
Field Detail
-
builders
protected static Map<SphereVBO.SphereKey,SphereVBO.VBOSphereMeshBuilder> builders
-
-
Method Detail
-
updateBounds
public void updateBounds()
- Overrides:
updateBoundsin classDrawableVBO
-
mount
public void mount(IPainter painter)
Description copied from interface:IGLBindedResourceMount resources to gl context- Specified by:
mountin interfaceIGLBindedResource- Overrides:
mountin classDrawableVBO
-
draw
public void draw(IPainter painter)
Description copied from class:DrawableCall OpenGL2 routines for rendering the object.- Specified by:
drawin interfaceIGLRenderer- Overrides:
drawin 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
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 radiusstacks- number of latitudesslices- number of longitudes- Returns:
-
-