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 scale with distribution

P5js Modifying scale with distribution

This content is archived.
Learn more
Aug 10, 2021

 

int gridW = 12;
int gridH = 12;
int border = 60;
int stepX = 60;
int stepY = 60;
float sizeModifier = 1.05;
int graphicSize = 30;


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

, multiple selections available,
{"serverDuration": 23, "requestCorrelationId": "7d184e08041a42c9bfe90b4ff30219cc"}