/** * Project a coordinate * * @param x X * @param y Y * @param z Z * @param out output buffer */ public void project(double x, double y, double z, double[] out) { glu.gluProject(x, y, z, modelview, 0, projection, 0, viewp, 0, out, 0); }
/** * Unproject a screen coordinate (at depth 0) to 3D model coordinates. * * @param x X * @param y Y * @param z Z * @param out output buffer */ public void unproject(double x, double y, double z, double[] out) { glu.gluUnProject(x, y, z, modelview, 0, projection, 0, viewp, 0, out, 0); }
@Override public void reshape(GLAutoDrawable arg0, int arg1, int arg2, int arg3, int arg4) { GL2 gl2 = arg0.getGL().getGL2(); gl2.glMatrixMode(GL2.GL_PROJECTION); gl2.glLoadIdentity(); // coordinate system origin at lower left with width and height same as the window GLU glu = new GLU(); glu.gluOrtho2D(0.0f, getWidth(), 0.0f, getHeight()); gl2.glMatrixMode(GL2.GL_MODELVIEW); gl2.glLoadIdentity(); gl2.glViewport(0, 0, getWidth(), getHeight()); controller.updateExtents(arg3 / 2, arg4 / 2); } }
/** * Create a tesselator which triangulates all {@link SimpleAccessGeometry} of a {@link GeometryQualityModel}. * * @param useDirectBuffers * to use direct buffers instead of heap buffers. */ public Tesselator( boolean useDirectBuffers ) { glu = new GLU(); this.useDirectBuffers = useDirectBuffers; }
@Override public void errorData( int arg0, Object originalVertex ) { super.errorData( arg0, originalVertex ); throw new IllegalArgumentException( "Error while tesselating: " + originalVertex + " cause: " + glu.gluErrorString( arg0 ) ); // LOG.error( ); }
/** * Instantiates a GLU implementation object in respect to the given GL profile * of this thread current GL. */ public static final GLU createGLU() throws GLException { return createGLU(getCurrentGL()); }
/** Option (throws GLException if not available in profile). <br> Interface to C language function: <br> <code> void gluDisk(GLUquadric * quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops); </code> */ public final void gluDisk(GLUquadric quad, double inner, double outer, int slices, int loops) { validateGLUquadricImpl(); ((GLUquadricImpl) quad).drawDisk(getCurrentGL(), (float) inner, (float) outer, slices, loops); }
/** Option (throws GLException if not available in profile). <br> Interface to C language function: <br> <code> GLUquadric * gluNewQuadric(void); </code> */ public final GLUquadric gluNewQuadric() { return gluNewQuadric(false, null, 0); }
void callEdgeFlagOrEdgeFlagData(final boolean a) { if (callEdgeFlagData != NULL_CB) callEdgeFlagData.edgeFlagData(a, polygonData); else callEdgeFlag.edgeFlag(a); }
void callCombineOrCombineData(final double[] coords, final Object[] vertexData, final float[] weights, final Object[] outData) { if (callCombineData != NULL_CB) callCombineData.combineData(coords, vertexData, weights, outData, polygonData); else callCombine.combine(coords, vertexData, weights, outData); }
void callVertexOrVertexData(final Object a) { if (callVertexData != NULL_CB) callVertexData.vertexData(a, polygonData); else callVertex.vertex(a); }
DebugListener(final GL gl, final Frame frame) { this.glu = GLU.createGLU(gl); this.frame = frame; }
/** * Register the callback with the given tesselator. * * @param tess * to register with * @param cb * the callback object. */ private void registerCallback( GLUtessellator tess, GeometryCallBack cb ) { glu.gluTessCallback( tess, GLU.GLU_TESS_BEGIN, cb ); glu.gluTessCallback( tess, GLU.GLU_TESS_EDGE_FLAG_DATA, cb ); glu.gluTessCallback( tess, GLU.GLU_TESS_VERTEX_DATA, cb ); glu.gluTessCallback( tess, GLU.GLU_TESS_END_DATA, cb ); glu.gluTessCallback( tess, GLU.GLU_TESS_COMBINE_DATA, cb ); glu.gluTessCallback( tess, GLU.GLU_TESS_ERROR_DATA, cb ); }
/** Option (throws GLException if not available in profile). <br> Interface to C language function: <br> <code> void gluDeleteQuadric(GLUquadric * quad); </code> */ public final void gluDeleteQuadric(GLUquadric quad) { validateGLUquadricImpl(); }
public final GLUquadric gluNewQuadric(boolean useGLSL, ShaderState st) { return gluNewQuadric(useGLSL, st, 0); }
/** Option (throws GLException if not available in profile). <br> Interface to C language function: <br> <code> void gluQuadricTexture(GLUquadric * quad, GLboolean texture); </code> */ public final void gluQuadricTexture(GLUquadric quad, boolean texture) { validateGLUquadricImpl(); ((GLUquadricImpl) quad).setTextureFlag(texture); }
public final GLUquadric gluNewQuadric(boolean useGLSL, int shaderProgram) { return gluNewQuadric(useGLSL, null, shaderProgram); }