MCPcopy
hub / github.com/processing/p5.js / drawCircle

Function drawCircle

test/unit/webgl/p5.Framebuffer.js:557–572  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

555 const fbo = myp5.createFramebuffer();
556
557 const drawCircle = () => {
558 myp5.clear();
559 myp5.noFill();
560 myp5.stroke(0);
561 myp5.strokeWeight(20);
562 myp5.beginShape();
563 for (let i = 0; i < 20; i++) {
564 const angle = i/20*myp5.TWO_PI;
565 myp5.vertex(
566 100 * myp5.cos(angle),
567 // Add an offset to make sure results don't get flipped
568 100 * myp5.sin(angle) - 50
569 );
570 }
571 myp5.endShape(myp5.CLOSE);
572 };
573
574 fbo.draw(drawCircle);
575 fbo.loadPixels();

Callers 1

p5.Framebuffer.jsFile · 0.85

Calls 7

noFillMethod · 0.80
clearMethod · 0.45
strokeMethod · 0.45
strokeWeightMethod · 0.45
beginShapeMethod · 0.45
vertexMethod · 0.45
endShapeMethod · 0.45

Tested by

no test coverage detected