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.
  • Tiling and Repetition
    • Arrays and lists for visual grids
    • Exercises
    • Modifying distribution along width and height
    • Modifying rotation by distribution
    • Modifying scale with distribution
  • Reactors
  • Programming Basics: Parametric and Generative Graphic Design 2016
  • Archive
  • High Scores
  • Artificial Neural Network
  • Alternatives to the Processing IDE
  • p5.js Programming
  • Programming in Processing (java)

/
Modifying rotation by distribution

Modifying rotation by distribution

Nov 07, 2017


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,

Related content

Modifying distribution along width and height
Modifying distribution along width and height
Programming
More like this
Modifying scale with distribution
Modifying scale with distribution
Programming
More like this
p5.js Tiling and Repetition
p5.js Tiling and Repetition
Programming
More like this
(Extra) Curve Reactor
(Extra) Curve Reactor
Programming
More like this
Coordinates (en)
Coordinates (en)
Programming
More like this
p5.js Particle System
p5.js Particle System
Programming
More like this
{"serverDuration": 57, "requestCorrelationId": "3b2ad91a54554511b9f34aade8466966"}