/** * Draws a tool at the current work coordinates. */ private void renderTool(GLAutoDrawable drawable) { GL2 gl = drawable.getGL().getGL2(); gl.glLineWidth(8.0f); byte []color; color = VisualizerUtils.Color.YELLOW.getBytes(); int verts = 0; int colors = 0; gl.glBegin(GL_LINES); gl.glColor3ub(color[0], color[1], color[2]); gl.glVertex3d(this.workCoord.x, this.workCoord.y, this.workCoord.z); gl.glColor3ub(color[0], color[1], color[2]); gl.glVertex3d(this.workCoord.x, this.workCoord.y, this.workCoord.z+(1.0/this.scaleFactor)); gl.glEnd(); }
private void drawQuad(GL2 gl, Point2D.Double point, double quadSize){ gl.glBegin(GL2.GL_QUADS); gl.glVertex3d(point.x - quadSize, point.y - quadSize, zCoord); gl.glVertex3d(point.x - quadSize, point.y + quadSize, zCoord); gl.glVertex3d(point.x + quadSize, point.y + quadSize, zCoord); gl.glVertex3d(point.x + quadSize, point.y - quadSize, zCoord); gl.glEnd(); }
gl.glVertex3d(lineVertexData[verts++], lineVertexData[verts++], lineVertexData[verts++]); gl.glColor3ub(lineColorData[colors++],lineColorData[colors++],lineColorData[colors++]); gl.glVertex3d(lineVertexData[verts++], lineVertexData[verts++], lineVertexData[verts++]);
private void drawQuad(GL2 gl, double xs, double xe, double ys, double ye, Color color) { gl.glColor4d(color.getRed()/255., color.getGreen()/255.,color.getBlue()/255.,color.getAlpha()/255.); double z = 0; gl.glBegin(GL2.GL_QUADS); gl.glVertex3d(xs, ys, z); gl.glVertex3d(xe, ys, z); gl.glVertex3d(xe, ye, z); gl.glVertex3d(xs, ye, z); gl.glEnd(); } private void drawCaption(OTFOGLDrawer drawer) {
private void drawBackFace(GL2 gl, double cx, double cy, double cz, double tileSize) { gl.glTexCoord2d(0.75, (double)1/3); gl.glVertex3d(cx-tileSize/2, cy+tileSize/2, cz-tileSize/2); gl.glTexCoord2d(1, (double)1/3); gl.glVertex3d(cx+tileSize/2, cy+tileSize/2, cz-tileSize/2); gl.glTexCoord2d(1, (double)2/3); gl.glVertex3d(cx+tileSize/2, cy-tileSize/2, cz-tileSize/2); gl.glTexCoord2d(0.75, (double)2/3); gl.glVertex3d(cx-tileSize/2, cy-tileSize/2, cz-tileSize/2); }
private void drawLine(GL2 gl, Point3d begin, Point3d end) { gl.glBegin(GL.GL_LINES); gl.glVertex3d(begin.x, begin.y, begin.z); gl.glVertex3d(end.x, end.y, end.z); gl.glEnd(); }
private void drawLowerFace(GL2 gl, double cx, double cy, double cz, double tileSize) { gl.glTexCoord2d((double)1/4, (double)2/3); gl.glVertex3d(cx+tileSize/2, cy-tileSize/2, cz+tileSize/2); gl.glTexCoord2d((double)1/2, (double)2/3); gl.glVertex3d(cx-tileSize/2, cy-tileSize/2, cz+tileSize/2); gl.glTexCoord2d((double)1/2, (double)1); gl.glVertex3d(cx-tileSize/2, cy-tileSize/2, cz-tileSize/2); gl.glTexCoord2d((double)1/4, (double)1); gl.glVertex3d(cx+tileSize/2, cy-tileSize/2, cz-tileSize/2); }
private void drawLine(GL2 gl, double beginX, double beginY, double beginZ, double endX, double endY, double endZ) { gl.glBegin(GL.GL_LINES); gl.glVertex3d(beginX, beginY, beginZ); gl.glVertex3d(endX, endY, endZ); gl.glEnd(); }
public static void glVertex3d( double x, double y, double z) { gl().glVertex3d( x, y, z); }
private void drawUpperFace(GL2 gl, double cx, double cy, double cz, double tileSize) { gl.glTexCoord2d((double)1/4, 0); gl.glVertex3d(cx+tileSize/2, cy+tileSize/2, cz-tileSize/2); gl.glTexCoord2d((double)1/2, 0); gl.glVertex3d(cx-tileSize/2, cy+tileSize/2, cz-tileSize/2); gl.glTexCoord2d((double)1/2, (double)1/3); gl.glVertex3d(cx-tileSize/2, cy+tileSize/2, cz+tileSize/2); gl.glTexCoord2d((double)1/4, (double)1/3); gl.glVertex3d(cx+tileSize/2, cy+tileSize/2, cz+tileSize/2); }
private void drawFrontFace(GL2 gl, double cx, double cy, double cz, double tileSize) { gl.glTexCoord2d(0.25, (double)1/3); gl.glVertex3d(cx+tileSize/2, cy+tileSize/2, cz+tileSize/2); gl.glTexCoord2d(0.5, (double)1/3); gl.glVertex3d(cx-tileSize/2, cy+tileSize/2, cz+tileSize/2); gl.glTexCoord2d(0.5, (double)2/3); gl.glVertex3d(cx-tileSize/2, cy-tileSize/2, cz+tileSize/2); gl.glTexCoord2d(0.25, (double)2/3); gl.glVertex3d(cx+tileSize/2, cy-tileSize/2, cz+tileSize/2); }
private void drawRightFace(GL2 gl, double cx, double cy, double cz, double tileSize) { gl.glTexCoord2d(0.5, (double)1/3); gl.glVertex3d(cx-tileSize/2, cy+tileSize/2, cz+tileSize/2); gl.glTexCoord2d(0.75, (double)1/3); gl.glVertex3d(cx-tileSize/2, cy+tileSize/2, cz-tileSize/2); gl.glTexCoord2d(0.75, (double)2/3); gl.glVertex3d(cx-tileSize/2, cy-tileSize/2, cz-tileSize/2); gl.glTexCoord2d(0.5, (double)2/3); gl.glVertex3d(cx-tileSize/2, cy-tileSize/2, cz+tileSize/2); }
private void drawLeftFace(GL2 gl, double cx, double cy, double cz, double tileSize) { gl.glTexCoord2d(0, (double)1/3); gl.glVertex3d(cx+tileSize/2, cy+tileSize/2, cz-tileSize/2); gl.glTexCoord2d(0.25, (double)1/3); gl.glVertex3d(cx+tileSize/2, cy+tileSize/2, cz+tileSize/2); gl.glTexCoord2d(0.25, 0.66); gl.glVertex3d(cx+tileSize/2, cy-tileSize/2, cz+tileSize/2); gl.glTexCoord2d(0.0, 0.66); gl.glVertex3d(cx+tileSize/2, cy-tileSize/2, cz-tileSize/2); }
private void drawVertex(GL2 gl, Point2D.Double startPoint, Point2D.Double endPoint, float lineWidth){ gl.glLineWidth(lineWidth); gl.glBegin(GL2.GL_LINES); gl.glVertex3d(startPoint.x, startPoint.y , zCoord); gl.glVertex3d(endPoint.x, endPoint.y, zCoord); gl.glEnd(); }
private static void drawArrowFromAgentToTextLabel(Point2D.Double pos, GL2 gl) { gl.glColor4f(0.f, 0.2f, 1.f, 0.5f);// Blue gl.glLineWidth(2); gl.glBegin(GL.GL_LINE_STRIP); gl.glVertex3d((float) pos.x + 50, (float) pos.y + 50, 0); gl.glVertex3d((float) pos.x + 250, (float) pos.y + 250, 0); gl.glEnd(); }
public void drawLine(Vector3 a, Vector3 b) { gl.glBegin(GL.GL_LINES); gl.glVertex3d(a.x, a.y, a.z); gl.glVertex3f(b.x, b.y, b.z); gl.glEnd(); }
@Override public void display(GLAutoDrawable glAutoDrawable) { GL2 gl = (GL2) glAutoDrawable.getGL(); for(OTFFeature feature : featureList) { gl.glColor4f(feature.color[0],feature.color[1],feature.color[2],feature.color[3]); gl.glBegin(feature.glType); for (int i = 0; i < feature.npoints; i++) { gl.glVertex3d(feature.xpoints[i], feature.ypoints[i], 0); } gl.glEnd(); } }
public void drawLine(Point3D a, Point3D b) { gl.glBegin(GL.GL_LINES); gl.glVertex3d(a.getX(), a.getY(), a.getZ()); gl.glVertex3d(b.getX(), b.getY(), b.getZ()); gl.glEnd(); }
public void drawTickLine(GL gl, Color color, double xpos, double ypos, double zpos, double xlab, double ylab, double zlab) { gl.getGL2().glColor3f(color.r, color.g, color.b); gl.getGL2().glLineWidth(1); // Draw the tick line gl.getGL2().glBegin(GL.GL_LINES); gl.getGL2().glVertex3d(xpos, ypos, zpos); gl.getGL2().glVertex3d(xlab, ylab, zlab); gl.getGL2().glEnd(); }
public void drawLine(Point3D a, Vector3 b) { gl.glBegin(GL.GL_LINES); gl.glVertex3d(a.getX(), a.getY(), a.getZ()); gl.glVertex3f(b.x, b.y, b.z); gl.glEnd(); }