Skip to content

Commit

Permalink
offset ellipse to please wyatt james thelen
Browse files Browse the repository at this point in the history
  • Loading branch information
gar354 committed Oct 19, 2023
1 parent 318553c commit 6d739e1
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions Scales.pde
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// feel free to change these!
int rows = 20;
int columns = 20;
float minLength = 200.0;
float maxLength = 100.0;
float increment = .01;
float alpha = 240.0;
int rows = 10;
int columns = 10;
float minLength = 100.0;
float maxLength = 50.0;
float increment = .005;
// =========================
int xSize;
int ySize;
Expand All @@ -15,6 +14,8 @@ color targetColor = color(0, 0, 0);
int offset = 0;
float currentLength = minLength;
float lengthDiv = currentLength / 2;
float alpha = 255.0;

void setup() {
offset = (int)minLength / 2;
xSize = offset * columns;
Expand All @@ -25,10 +26,10 @@ void setup() {

void draw() {
background(255);
lengthDiv = currentLength / 2;
for (int y = 0; y < rows; y++) {
lengthDiv = currentLength / 2; //divide current length by 2
for (int y = 0; y < rows; y++) { // rows
int flippedY = rows - y - 1;
for (int x = 0; x < columns; x++) {
for (int x = 0; x < columns; x++) { // columns
scale(x * lengthDiv, flippedY * lengthDiv);
}
time += increment;
Expand All @@ -45,8 +46,8 @@ void draw() {

void scale(float x, float y) {
fill(shapeColor, alpha);
ellipse(x, y + lengthDiv, currentLength, currentLength);
rect(x - lengthDiv * 0.5, y - lengthDiv * 0.5, lengthDiv, lengthDiv);
ellipse(x, y, currentLength, currentLength);
rect(x - lengthDiv, y - lengthDiv * 0.5, currentLength, lengthDiv);
}

void mousePressed() {
Expand Down

0 comments on commit 6d739e1

Please sign in to comment.