Java Code Examples for processing.core.PGraphics#noFill()
The following examples show how to use
processing.core.PGraphics#noFill() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TiledTexture.java From haxademic with MIT License | 6 votes |
public void drawDebug(PGraphics pg) { // fit to small box // draw background pg.stroke(0); pg.fill(0); pg.rect(0, 0, texture.width, texture.height); // draw image pg.image(texture, 0, 0, texture.width, texture.height); // show texture grab area // float halfSizeX = (sizeX * (float) texture.width) / 2f; // float halfSizeY = (sizeY * (float) texture.height) / 2f; pg.stroke(255, 0, 0, 200); pg.noFill(); pg.beginShape(); pg.vertex(tlX, tlY); pg.vertex(trX, trY); pg.vertex(brX, brY); pg.vertex(blX, blY); pg.vertex(tlX, tlY); pg.endShape(); }
Example 2
Source File: QuadSurface.java From sketch-mapper with MIT License | 6 votes |
/** * Draws the Cornerpoints * * @param g * @param x * @param y * @param selected * @param cornerIndex */ private void renderCornerPoint(PGraphics g, float x, float y, boolean selected, int cornerIndex) { g.noFill(); g.strokeWeight(2); if (selected) { g.stroke(QuadSurface.SELECTED_CORNER_MARKER_COLOR); } else { g.stroke(QuadSurface.CORNER_MARKER_COLOR); } if (cornerIndex == getSelectedCorner() && isSelected()) { g.fill(QuadSurface.SELECTED_CORNER_MARKER_COLOR, 100); g.stroke(QuadSurface.SELECTED_CORNER_MARKER_COLOR); } g.ellipse(x, y, 10, 10); g.line(x, y - 5, x, y + 5); g.line(x - 5, y, x + 5, y); }
Example 3
Source File: BezierSurface.java From sketch-mapper with MIT License | 6 votes |
/** * Draws the bezier points * * @param g * @param x * @param y * @param selected * @param cornerIndex */ private void renderBezierPoint(PGraphics g, float x, float y, boolean selected, int cornerIndex) { g.noFill(); g.strokeWeight(1); if (selected) { g.stroke(BezierSurface.SELECTED_CORNER_MARKER_COLOR); } else { g.stroke(BezierSurface.CORNER_MARKER_COLOR); } if (cornerIndex == getSelectedBezierControl() && isSelected()) { g.fill(BezierSurface.SELECTED_CORNER_MARKER_COLOR, 100); g.stroke(BezierSurface.SELECTED_CORNER_MARKER_COLOR); } g.ellipse(x, y, 10, 10); g.line(x, y - 5, x, y + 5); g.line(x - 5, y, x + 5, y); }
Example 4
Source File: BezierSurface.java From sketch-mapper with MIT License | 6 votes |
/** * Draws the Corner points * * @param g * @param x * @param y * @param selected * @param cornerIndex */ private void renderCornerPoint(PGraphics g, float x, float y, boolean selected, int cornerIndex) { g.noFill(); g.strokeWeight(2); if (selected) { g.stroke(BezierSurface.SELECTED_CORNER_MARKER_COLOR); } else { g.stroke(BezierSurface.CORNER_MARKER_COLOR); } if (cornerIndex == getSelectedCorner() && isSelected()) { g.fill(BezierSurface.SELECTED_CORNER_MARKER_COLOR, 100); g.stroke(BezierSurface.SELECTED_CORNER_MARKER_COLOR); } g.ellipse(x, y, 10, 10); g.line(x, y - 5, x, y + 5); g.line(x - 5, y, x + 5, y); }
Example 5
Source File: BaseMappedPolygon.java From haxademic with MIT License | 6 votes |
protected void drawFlashFadeOverlay(PGraphics pg) { // run flash fading _isFlash *= 0.9f; if(_isFlash > 0.01f) { if(_isFlashMode == 0) { if(_isWireMode == 0) { pg.noStroke(); pg.fill(0, _isFlash * 255f); } else { pg.stroke(0, _isFlash * 255f); pg.strokeWeight(1.1f); pg.noFill(); } } else { if(_isWireMode == 0) { pg.noStroke(); pg.fill(255, _isFlash * 255f); } else { pg.stroke(255, _isFlash * 255f); pg.strokeWeight(1.1f); pg.noFill(); } } rawDrawPolygon(pg); } }
Example 6
Source File: BFLinewaveRender.java From haxademic with MIT License | 5 votes |
public void update(PGraphics pg, float frameOsc) { _x.update(); _y.update(); pg.noFill(); pg.stroke(0); pg.strokeWeight(HEIGHT); p.strokeCap(P.SQUARE); float third = 1f/3f; float twoThird = 2f/3f; float sixth = 1f/6f; float curveAdd = 1.25f; curveAdd = curveAdd/2f + frameOsc * curveAdd/2f; pg.beginShape(); pg.vertex(_x.value(), _y.value()); pg.bezierVertex( _x.value() + WIDTH * sixth, _y.value(), _x.value() + WIDTH * sixth, _y.value() + _index * curveAdd, _x.value() + WIDTH * third, _y.value() + _index * curveAdd ); pg.bezierVertex( _x.value() + WIDTH * (third + sixth), _y.value() + _index * curveAdd, _x.value() + WIDTH * (third + sixth), _y.value(), _x.value() + WIDTH * twoThird, _y.value() ); pg.bezierVertex( _x.value() + WIDTH * (twoThird + sixth), _y.value(), _x.value() + WIDTH * (twoThird + sixth), _y.value() + _index * curveAdd, _x.value() + WIDTH, _y.value() + _index * curveAdd ); pg.endShape(); }
Example 7
Source File: ImageGradient.java From haxademic with MIT License | 5 votes |
public void drawDebug(PGraphics pg) { pg.image(gradientImg, 0, 0); pg.stroke(255, 0, 0); pg.noFill(); pg.rect(sampleX - 1, 0, 3, gradientImg.height); pg.fill(255); pg.noStroke(); }
Example 8
Source File: DrawToxiMesh.java From haxademic with MIT License | 5 votes |
public static void drawMeshWithAudio( PGraphics p, WETriangleMesh mesh, AudioInputWrapper audioInput, boolean isWireframe, int fillColor, int strokeColor, float baseAlpha ) { p.beginShape(PConstants.TRIANGLES); int faceIndex = 0; int color = fillColor; int colorStroke = strokeColor; float alpha; Face f; int numVertices = mesh.getNumVertices(); int eqStep = Math.round( 512f / (float) numVertices ); for (Iterator<Face> i = mesh.faces.iterator(); i.hasNext();) { // set colors alpha = baseAlpha + audioInput.getFFT().spectrum[(faceIndex*eqStep)%512]; if( isWireframe ) { p.noFill(); p.stroke( colorStroke, ( baseAlpha + alpha ) * 255 ); } else { p.noStroke(); p.fill( color, ( baseAlpha + alpha ) * 255 ); } f = i.next(); normalMap.applyTo(f.a.normal); p.normal(f.a.normal.x, f.a.normal.y, f.a.normal.z); p.vertex(f.a.x, f.a.y, f.a.z); normalMap.applyTo(f.b.normal); p.normal(f.b.normal.x, f.b.normal.y, f.b.normal.z); p.vertex(f.b.x, f.b.y, f.b.z); normalMap.applyTo(f.c.normal); p.normal(f.c.normal.x, f.c.normal.y, f.c.normal.z); p.vertex(f.c.x, f.c.y, f.c.z); faceIndex ++; } p.endShape(); }
Example 9
Source File: Polygon.java From haxademic with MIT License | 5 votes |
protected void drawShapeOutline(PGraphics pg) { pg.noFill(); pg.stroke(255, 255, 255, 100); pg.beginShape(); for (int i = 0; i < vertices.size(); i++) { PVector v = vertices.get(i); pg.vertex(v.x, v.y, v.z); } pg.endShape(P.CLOSE); }
Example 10
Source File: Shapes.java From haxademic with MIT License | 5 votes |
public static void drawDashedBox(PGraphics pg, float w, float h, float d, float dashLength, boolean dashRounds) { float halfW = w / 2f; float halfH = h / 2f; float halfD = d / 2f; // set stroke params pg.noFill(); // pg.stroke(255); // pg.strokeWeight(2f); pg.strokeCap(P.ROUND); // SQUARE, PROJECT, or ROUND // front face: top, right, bottom, left float frontFaceZ = halfD; drawDashedLine(pg, -halfW, -halfH, frontFaceZ, halfW, -halfH, frontFaceZ, dashLength, dashRounds); drawDashedLine(pg, halfW, -halfH, frontFaceZ, halfW, halfH, frontFaceZ, dashLength, dashRounds); drawDashedLine(pg, halfW, halfH, frontFaceZ, -halfW, halfH, frontFaceZ, dashLength, dashRounds); drawDashedLine(pg, -halfW, halfH, frontFaceZ, -halfW, -halfH, frontFaceZ, dashLength, dashRounds); // back face: top, right, bottom, left float backFaceZ = -halfD; drawDashedLine(pg, -halfW, -halfH, backFaceZ, halfW, -halfH, backFaceZ, dashLength, dashRounds); drawDashedLine(pg, halfW, -halfH, backFaceZ, halfW, halfH, backFaceZ, dashLength, dashRounds); drawDashedLine(pg, halfW, halfH, backFaceZ, -halfW, halfH, backFaceZ, dashLength, dashRounds); drawDashedLine(pg, -halfW, halfH, backFaceZ, -halfW, -halfH, backFaceZ, dashLength, dashRounds); // connect front & back faces, start at top left, clockwise, front to back drawDashedLine(pg, -halfW, -halfH, frontFaceZ, -halfW, -halfH, backFaceZ, dashLength, dashRounds); drawDashedLine(pg, halfW, -halfH, frontFaceZ, halfW, -halfH, backFaceZ, dashLength, dashRounds); drawDashedLine(pg, halfW, halfH, frontFaceZ, halfW, halfH, backFaceZ, dashLength, dashRounds); drawDashedLine(pg, -halfW, halfH, frontFaceZ, -halfW, halfH, backFaceZ, dashLength, dashRounds); }
Example 11
Source File: LeapRegion.java From haxademic with MIT License | 5 votes |
public void drawDebug(PGraphics debugGraphics) { if( _blockColor == -1 ) return; // set box color for (in)active states debugGraphics.strokeWeight(5f); if(_isActive == true) { debugGraphics.stroke(_blockColor, 255); debugGraphics.noFill(); } else { debugGraphics.stroke(255, 127); debugGraphics.noFill(); } debugGraphics.pushMatrix(); // move to center of box location & draw box debugGraphics.translate(P.lerp(_right, _left, 0.5f), P.lerp(_top, _bottom, 0.5f), -1f * P.lerp(_far, _near, 0.5f)); debugGraphics.box(_right - _left, _top - _bottom, _far - _near); // draw text control values if(_isActive == true) { debugGraphics.noStroke(); debugGraphics.fill(255); debugGraphics.textSize(24); debugGraphics.text(MathUtil.roundToPrecision(_controlX, 2)+", "+MathUtil.roundToPrecision(_controlY, 2)+", "+MathUtil.roundToPrecision(_controlZ, 2), -50, 0); } debugGraphics.popMatrix(); }
Example 12
Source File: RotateRectVertices.java From haxademic with MIT License | 5 votes |
public void drawRect(PGraphics pg, float drawW, float drawH, float size, float rotation) { float halfDrawW = drawW / 2f; float halfDrawH = drawH / 2f; float halfSizeX = halfDrawW * size; float halfSizeY = halfDrawH * size; pg.noFill(); pg.stroke(255,0,0); pg.beginShape(); if(rotation == 0) { pg.vertex(-halfSizeX, -halfSizeY); pg.vertex(halfSizeX, -halfSizeY); pg.vertex(halfSizeX, halfSizeY); pg.vertex(-halfSizeX, halfSizeY); pg.vertex(-halfSizeX, -halfSizeY); } else { float curRot = rotation; float radius = MathUtil.getDistance(0, 0, halfSizeX, halfSizeY); float tlRads = -MathUtil.getRadiansToTarget(-halfSizeX, -halfSizeY, 0, 0) + curRot; float trRads = -MathUtil.getRadiansToTarget(halfSizeX, -halfSizeY, 0, 0) + curRot; float brRads = -MathUtil.getRadiansToTarget(halfSizeX, halfSizeY, 0, 0) + curRot; float blRads = -MathUtil.getRadiansToTarget(-halfSizeX, halfSizeY, 0, 0) + curRot; pg.vertex(radius * P.cos(tlRads), -radius * P.sin(tlRads)); pg.vertex(radius * P.cos(trRads), -radius * P.sin(trRads)); pg.vertex(radius * P.cos(brRads), -radius * P.sin(brRads)); pg.vertex(radius * P.cos(blRads), -radius * P.sin(blRads)); pg.vertex(radius * P.cos(tlRads), -radius * P.sin(tlRads)); } pg.endShape(); }
Example 13
Source File: Demo_MultichannelAudio_BeadsJack.java From haxademic with MIT License | 5 votes |
public void update(PGraphics pg) { // draw stage pg.push(); pg.noFill(); pg.stroke(0, 0, 255); PG.setDrawCenter(pg); PG.setCenterScreen(pg); pg.ellipse(position.x, position.y, 30, 30); pg.pop(); }
Example 14
Source File: Demo_MultichannelAudio_BeadsJack.java From haxademic with MIT License | 5 votes |
public void update(PGraphics pg) { // draw stage pg.push(); pg.noFill(); pg.stroke(255); PG.setDrawCenter(pg); PG.setCenterScreen(pg); pg.ellipse(0, 0, radius * 2, radius * 2); pg.pop(); // draw speakers for (int i = 0; i < numSpeakers; i++) { speakers[i].update(pg); } }
Example 15
Source File: Demo_MultichannelAudio_BeadsJack.java From haxademic with MIT License | 5 votes |
public void update(PGraphics pg) { // draw pg.push(); pg.noFill(); pg.stroke(0, 255, 0); PG.setDrawCenter(pg); PG.setCenterScreen(pg); pg.ellipse(position.x, position.y, 20, 20); pg.pop(); // set gains for (int i = 0; i < outputs; i++) { // get dist to speaker PVector speakerPos = stage.getSpeaker(i).position(); float dist = speakerPos.dist(position); float distToGain = P.map(dist, 0, stage.radius() * 2, 1, 0); distToGain = P.constrain(distToGain, 0, 1); gains[i].setGain(distToGain); // draw debug to speakers pg.push(); pg.noFill(); pg.stroke(0, 255 * distToGain, 0); PG.setDrawCenter(pg); PG.setCenterScreen(pg); pg.line(position.x, position.y, speakerPos.x, speakerPos.y); float midX = (position.x + speakerPos.x) / 2f; float midY = (position.y + speakerPos.y) / 2f; pg.text(distToGain, midX, midY); pg.pop(); } }
Example 16
Source File: DwMagnifier.java From PixelFlow with MIT License | 5 votes |
public void display(PGraphics pg_canvas, int x, int y){ setDisplayPosition(x, y); pg_canvas.image(pg_region, x, y, w, h); pg_canvas.rectMode(PConstants.CORNER); pg_canvas.stroke(128); pg_canvas.strokeWeight(1); pg_canvas.noFill(); pg_canvas.rect(x, y, w, h); }
Example 17
Source File: LightBar.java From haxademic with MIT License | 4 votes |
public void update(PGraphics pg, int index) { // update midpoint midPoint.set(point1); midPoint.lerp(point2, 0.5f); // draw if(active) { // draw enclosing circle to highlight tube float highlightSize = point1.dist(point2) + 50; pg.noFill(); pg.strokeWeight(1); pg.stroke(0, 255, 0); pg.ellipse(midPoint.x, midPoint.y, highlightSize, highlightSize); // flash color int rainbow = P.p.color( 127 + 127 * P.sin(P.p.frameCount * 0.1f), 127 + 127 * P.sin(P.p.frameCount * 0.15f), 127 + 127 * P.sin(P.p.frameCount * 0.225f)); dmxFixture.color().setCurrentInt((P.p.frameCount % 16 < 8) ? rainbow : P.p.color(0)); // dmxFixture.color().setCurrentInt(0xffff0000); } // draw light pg.noStroke(); pg.fill(dmxFixture.color().colorInt()); pg.push(); pg.translate(midPoint.x, midPoint.y); pg.rotate(MathUtil.getRadiansToTarget(point2.x, point2.y, point1.x, point1.y)); pg.rect(0, 0, point1.dist(point2), 5); pg.pop(); // small circular ends pg.ellipse(point1.x, point1.y, 3, 3); pg.ellipse(point2.x, point2.y, 3, 3); // show text labels overlay if(P.store.getBoolean(DMXEditor.SHOW_DMX_CHANNELS)) { drawNumberValue(pg, dmxChannel); } if(P.store.getBoolean(DMXEditor.SHOW_LIGHT_INDEX)) { drawNumberValue(pg, index); } }
Example 18
Source File: Interphase.java From haxademic with MIT License | 4 votes |
protected void drawSequencer(PGraphics pg) { float spacing = 40; float boxSize = 25; float startx = (spacing * sequencers.length) / -2f + boxSize/2; float startY = (spacing * NUM_STEPS) / -2f + boxSize/2; pg.beginDraw(); PG.setCenterScreen(pg); PG.basicCameraFromMouse(pg, 0.1f); PG.setBetterLights(pg); PG.setDrawCenter(pg); // draw cubes for (int x = 0; x < sequencers.length; x++) { for (int y = 0; y < NUM_STEPS; y++) { // float value = (sequencers[x].stepActive(y)) ? 1 : 0; boolean isOn = (sequencers[x].stepActive(y)); pg.fill(isOn ? P.p.color(255) : 30); pg.pushMatrix(); pg.translate(startx + x * spacing, startY + y * spacing); pg.box(20); pg.popMatrix(); } } // show beat/4 for (int y = 0; y < NUM_STEPS; y+=4) { // float value = (sequencers[x].stepActive(y)) ? 1 : 0; pg.stroke(255); pg.noFill(); pg.pushMatrix(); pg.translate(-boxSize/2, startY + y * spacing); Shapes.drawDashedBox(pg, spacing * (sequencers.length + 1), boxSize, boxSize, 10, true); pg.popMatrix(); } // track current beat int curBeat = P.store.getInt(BEAT) % NUM_STEPS; pg.stroke(255); pg.noFill(); pg.pushMatrix(); pg.translate(-boxSize/2, startY + curBeat * spacing); pg.box(spacing * (sequencers.length + 1), boxSize, boxSize); pg.popMatrix(); pg.endDraw(); }
Example 19
Source File: Rectangle.java From haxademic with MIT License | 4 votes |
public void draw(PGraphics pg) { pg.stroke(255); pg.noFill(); if(collided) pg.fill(0, 255, 0, 50); pg.rect(x, y, width, height); }
Example 20
Source File: BezierSurface.java From sketch-mapper with MIT License | 4 votes |
/** * Renders the grid in the surface. (useful in calibration mode) * * @param g */ private void renderGrid(PGraphics g) { g.beginDraw(); g.fill(ccolor); g.noStroke(); for (int i = 0; i < GRID_RESOLUTION; i++) { for (int j = 0; j < GRID_RESOLUTION; j++) { g.beginShape(); g.vertex(vertexPoints[i][j].x, vertexPoints[i][j].y); g.vertex(vertexPoints[i + 1][j].x, vertexPoints[i + 1][j].y); g.vertex(vertexPoints[i + 1][j + 1].x, vertexPoints[i + 1][j + 1].y); g.vertex(vertexPoints[i][j + 1].x, vertexPoints[i][j + 1].y); g.endShape(); } } g.textFont(sm.getIdFont()); g.fill(255); g.textAlign(PApplet.CENTER, PApplet.CENTER); g.textSize(20); g.text("" + this.getSurfaceName(), (float) (this.getCenter().x), (float) this.getCenter().y); if (isLocked) { g.textSize(12); g.text("Surface locked", (float) this.getCenter().x, (float) this.getCenter().y + 26); } if (sketch != null) { g.textSize(10); g.text(sketch.getName(), (float) this.getCenter().x, (float) this.getCenter().y + 40); } g.noFill(); g.stroke(BezierSurface.GRID_LINE_COLOR); g.strokeWeight(2); if (isSelected) g.stroke(BezierSurface.GRID_LINE_SELECTED_COLOR); if (!isLocked) { for (int i = 0; i <= GRID_RESOLUTION; i++) { for (int j = 0; j <= GRID_RESOLUTION; j++) { g.point(vertexPoints[i][j].x, vertexPoints[i][j].y, vertexPoints[i][j].z); } } } if (isSelected) { g.strokeWeight(4); g.stroke(BezierSurface.GRID_LINE_SELECTED_COLOR); //draw the outline here for (int i = 0; i < poly.npoints - 1; i++) { g.line(poly.xpoints[i], poly.ypoints[i], poly.xpoints[i + 1], poly.ypoints[i + 1]); if (i == poly.npoints - 2) g.line(poly.xpoints[i + 1], poly.ypoints[i + 1], poly.xpoints[0], poly.ypoints[0]); } } g.strokeWeight(1); g.stroke(SELECTED_OUTLINE_INNER_COLOR); //draw the outline here for (int i = 0; i < poly.npoints - 1; i++) { g.line(poly.xpoints[i], poly.ypoints[i], poly.xpoints[i + 1], poly.ypoints[i + 1]); if (i == poly.npoints - 2) g.line(poly.xpoints[i + 1], poly.ypoints[i + 1], poly.xpoints[0], poly.ypoints[0]); } if (!isLocked) { // Draw the control points. for (int i = 0; i < this.cornerPoints.length; i++) { this.renderCornerPoint(g, this.cornerPoints[i].x, this.cornerPoints[i].y, (this.activePoint == i), i); } for (int i = 0; i < this.bezierPoints.length; i++) { this.renderBezierPoint(g, this.bezierPoints[i].x, this.bezierPoints[i].y, (this.selectedBezierControl == i), i); g.strokeWeight(1); g.stroke(255); g.line(this.bezierPoints[i].x, this.bezierPoints[i].y, this.cornerPoints[(int) (i / 2)].x, this.cornerPoints[(int) (i / 2)].y); } } g.endDraw(); }