Class FeedbackBufferAxisBox

  • All Implemented Interfaces:
    IAxis

    public class FeedbackBufferAxisBox
    extends AxisBox
    implements IAxis
    This AxisBox implementation was the first to appear in Jzy3d. It computes hidden faces via method getHiddenQuads(org.jzy3d.painters.IPainter) using the OpenGL feedback buffer, which seems to fail on some laptop GPU. (especially Lenovo notepads).
    Author:
    Martin Pernollet
    • Method Detail

      • drawCube

        protected void drawCube​(IPainter painter,
                                RenderMode mode)
        Make all GL2 calls allowing to build a cube with 6 separate quads. Each quad is indexed from 0.0f to 5.0f using glPassThrough, and may be traced in feedback mode when mode=GL2.GL_FEEDBACK
        Overrides:
        drawCube in class AxisBox
      • getHiddenQuads

        protected boolean[] getHiddenQuads​(IPainter painter)
        Render the cube into the feedback buffer, in order to parse feedback and determine which quad where displayed or not.
        Overrides:
        getHiddenQuads in class AxisBox
      • getEmptyTokens

        protected boolean[] getEmptyTokens​(int ntokens,
                                           float[] buffer,
                                           int size)
        This utility function inform wether a GL_PASS_THROUGH_TOKEN was followed by other OpenGL tokens (GL_POLYGON_TOKEN, GL_LINE_TOKEN, etc), or not. In the first case, the given token is considered as non empty, in the other case, it is considered as empty. The expected use of this function is to inform the user wether a polygon has been displayed or not in the case Culling was activated. Note: this function is only intended to work in the case where gl.glFeedbackBuffer is called with GL.GL_3D_COLOR as second argument, i.e. vertices are made of x, y, z, alpha values and a color. Thus, no texture may be used, and trying to parse a GL_BITMAP_TOKEN, GL_DRAW_PIXEL_TOKEN, or GL_COPY_PIXEL_TOKEN will throw a RuntimeException. Note: this function only works with PASS_THROUGH_TOKEN with a positive integer value, since this value will be used as an index in the boolean array returned by the function TODO: use a map to associate a float token to a polygon with an id?
        Throws:
        a - RuntimeException if a parsed token is either GL_BITMAP_TOKEN, GL_DRAW_PIXEL_TOKEN, or GL_COPY_PIXEL_TOKEN.
      • print3DcolorVertex

        protected int print3DcolorVertex​(int size,
                                         int count,
                                         float[] buffer)
        Print out parameters of a gl call in 3dColor mode.