/** * 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(); }
gl.glVertex3f( 0, 0, 50 ); gl.glEnd();
protected void drawCircle(GL2 gl2,float x,float y,float r) { gl2.glBegin(GL2.GL_LINE_LOOP); float f; for(f=0;f<2.0*Math.PI;f+=0.3f) { gl2.glVertex2d(x+Math.cos(f)*r,y+Math.sin(f)*r); } gl2.glEnd(); }
gl2.glTexCoord3f(0, 1, 0); gl2.glVertex3f(-width/2f, height/2f, 0); gl2.glEnd(); gl2.glPopMatrix(); textures[i].disable(gl2); gl2.glTexCoord3f(0, 1, 0); gl2.glVertex3f(-width/2f, height/2f, 0); gl2.glEnd(); gl2.glPopMatrix(); textures[i].disable(gl2); gl2.glTexCoord3f(0, 1, 0); gl2.glVertex3f(-shortSideHalf, shortSideHalf, 0); gl2.glEnd(); gl2.glPopMatrix(); gl2.glTexCoord3f(0, 1, 0); gl2.glVertex3f(-shortSideHalf, shortSideHalf, 0); gl2.glEnd(); gl2.glPopMatrix(); texYantra.disable(gl2);
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 drawFaces(GL2 gl, Group group, boolean drawTextures) { for (Face face : group.getFaces()) { gl.glBegin(GL2.GL_TRIANGLE_FAN); drawFace(gl, face, drawTextures); gl.glEnd(); } }
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 void drawBoundingBox(BoundingBox box) { gl.glBegin(GL2.GL_LINES); drawBoundingLines(box.min, box.max); drawBoundingLines(box.max, box.min); gl.glEnd(); }
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 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(); }
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 drawSquare(double size) { double halfSize = size/2; gl.glTranslated(0,0, halfSize); gl.glBegin(GL.GL_TRIANGLE_FAN); gl.glVertex2d(-halfSize,-halfSize); // Draw the square (before the gl.glVertex2d(halfSize,-halfSize); // the translation is applied) gl.glVertex2d(halfSize,halfSize); // on the xy-plane, with its gl.glVertex2d(-halfSize,halfSize); // at (0,0,0). gl.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(); }
public void drawGL2(GL gl) { gl.getGL2().glPointSize(width); gl.getGL2().glBegin(GL.GL_POINTS); if (coordinates != null) { for (Coord3d coord : coordinates) { colorGL2(gl, mapper.getColor(coord)); vertexGL2(gl, coord); } } gl.getGL2().glEnd(); }
public void drawGL2(GL gl) { gl.getGL2().glPointSize(width); gl.getGL2().glBegin(GL.GL_POINTS); if (points != null) { for (LightPoint p : points) { gl.getGL2().glColor4f(p.rgb.r, p.rgb.g, p.rgb.b, p.rgb.a); gl.getGL2().glVertex3f(p.xyz.x, p.xyz.y, p.xyz.z); } } gl.getGL2().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 synchronized void drawLineGL2(GL gl, Range yrange, Range zrange) { gl.getGL2().glLineWidth(width); gl.getGL2().glBegin(GL.GL_LINE_STRIP); gl.getGL2().glColor4f(color.r, color.g, color.b, color.a); gl.getGL2().glVertex3f(value, yrange.getMin()-yrange.getRange()/30, zrange.getMin()-2); gl.getGL2().glVertex3f(value, yrange.getMax()+yrange.getRange()/30, zrange.getMin()-2); gl.getGL2().glEnd(); }