/** * 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(); }
for(LineSegment ls : gcodeLineList) gl.glColor3ub(lineColorData[colors++],lineColorData[colors++],lineColorData[colors++]); gl.glVertex3d(lineVertexData[verts++], lineVertexData[verts++], lineVertexData[verts++]); gl.glColor3ub(lineColorData[colors++],lineColorData[colors++],lineColorData[colors++]); gl.glVertex3d(lineVertexData[verts++], lineVertexData[verts++], lineVertexData[verts++]);
public static void glColor3ub( byte red, byte green, byte blue) { gl().glColor3ub( red, green, blue); }
gl.glColor3ub((byte) COLOR_TRIANGLE_FILL.getRed(), (byte) COLOR_TRIANGLE_FILL.getGreen(), (byte) COLOR_TRIANGLE_FILL.getBlue()); gl.glBegin(GL.GL_TRIANGLES); gl.glColor3ub((byte) COLOR_TRIANGLE_EDGES.getRed(), (byte) COLOR_TRIANGLE_EDGES.getGreen(), (byte) COLOR_TRIANGLE_EDGES.getBlue()); gl.glBegin(GL.GL_LINES); gl.glColor3f(0.2f, 1.2f, 0.25f); gl.glColor3ub((byte) COLOR_TRIANGLE_BORDER.getRed(), (byte) COLOR_TRIANGLE_BORDER.getGreen(), (byte) COLOR_TRIANGLE_BORDER.getBlue()); gl.glBegin(GL.GL_POINTS);