MCPcopy Index your code
hub / github.com/processing/p5.js / drawCircles

Function drawCircles

test/bench/cpu_transforms.bench.js:59–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

57 }
58
59 const drawCircles = () => {
60 for (const s of state) {
61 myp5.push();
62 myp5.translate(s.pos.x, s.pos.y);
63 const pts = 500;
64 myp5.beginShape(myp5.TRIANGLE_FAN);
65 myp5.vertex(0, 0);
66 for (let i = 0; i <= pts; i++) {
67 const a = (i / pts) * myp5.TWO_PI;
68 myp5.vertex(5 * myp5.cos(a), 5 * myp5.sin(a));
69 }
70 myp5.endShape();
71 myp5.pop();
72 }
73 };
74
75 if (TEST_CPU_TRANSFORMS) {
76 // Flattens into a single buffer

Callers 1

Calls 6

pushMethod · 0.45
translateMethod · 0.45
beginShapeMethod · 0.45
vertexMethod · 0.45
endShapeMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected