Combining beginShape() with push/pop and translations
in
Programming Questions
•
7 months ago
Does anyone know why the following code does not produce an octagon?
- size(200, 200);
- background(255);
- fill(0);
- translate(100, 100);
- float ang = radians(360/8);
- beginShape();
- for (int i=0; i<8; i++) {
- pushMatrix();
- translate(50, 0);
- vertex(0, 0);
- ellipse(0,0,3,3); // where vertices should be
- popMatrix();
- rotate(ang);
- }
- endShape(CLOSE);
1