Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Confluence
For you

Programming
Results will update as you type.
  • Programming

/
P5js Modifying rotation by distribution

P5js Modifying rotation by distribution

This content is archived.
Learn more
Aug 10, 2021


int gridW = 14;
int gridH = 14;
int border = 70;
int stepX = 50;
int stepY = 50;
int graphicSize = 25;

void setup()
{
  size(800, 800);
  noStroke();
  fill(0);
  background(255);
  rectMode(CENTER);
  float rotation = 0;
  translate(border, border);
  for (int i=0; i < gridH; i++)
  {
    for (int j = 0; j < gridW; j++)
    {
      rotation++;
      pushMatrix();
      translate(j * stepX, i * stepY);
      rotate(radians(rotation));
      rect(0, 0, graphicSize, graphicSize);
      popMatrix();
    }
  }
}

, multiple selections available,
{"serverDuration": 10, "requestCorrelationId": "b9c123997cb640f09d18f3e545ceb9af"}