We are about to switch to a new forum software. Until then we have removed the registration on this forum.
void setup() {
size(320, 320);
smooth();
background(255);
strokeWeight(0); // Thicker
drawFibonnaciTiles(500);
}
void drawFibonnaciTiles(int iterations)
{
int r = 2; // red range 0 - 255
int g = 10; // green range 0 - 255
int b = 25; // blue range 0 - 255
stroke(1, 255);
int posx = 81;
int posy = 125;
int fibprev = -1;
int fibnew = 0;
for (int fib = 15; fib < iterations;) {
for (int a = 0; a < 4; a++) {
fibnew = fib + fibprev;
fibprev = fib;
fib = fibnew;
r = r + 0;
g = g + 10;
b = b + 1;
fill(random(255), random(255), random(255));
strokeWeight(1); // Thin
rect(posx, posy, fib, fib);
// triangle( posx+2, posy+2, posx-2, posy+2, fibnew, posy-2);
if (a == 0) {
strokeWeight(2); // Thicker
arc(posx + fib, posy + fib, fib*2, fib*2, PI, TWO_PI-PI/2);
posx = posx + fib;
} else if (a == 1) {
strokeWeight(2); // Thicker
arc(posx, posy + fib, fib*2, fib*2, TWO_PI-PI/2, TWO_PI);
posx = posx - fibprev;
posy = posy + fib;
} else if (a == 2) {
strokeWeight(2); // Thicker
arc(posx, posy, fib*2, fib*2, 0, PI/2);
posx = posx - fib - fibprev;
posy = posy - fibprev;
} else if (a == 3) {
strokeWeight(2); // Thicker
arc(posx + fib, posy, fib*2, fib*2, PI/2, PI);
posy = posy - fib - fibprev;
}
}
}
// Clock Border
rectMode(CENTER);
noFill();
strokeWeight(20);
rect(width/2, height/2, 320, 320);
// save("fibonacci_6"); // save a tif file
}
Hello guys, so this is my code, the title says everything, i want to replace my spiral with points but i don't know how to do that, please help me i m begging you.
Answers
probably from here: https://forum.processing.org/two/discussion/15770/how-to-map-an-ellipse-to-a-spiral
Please do not start multiple questions.
Could try something like this (adapted from https://timwolverson.wordpress.com/2014/02/08/plot-a-fibonacci-spiral-in-excel/)
And in your other post you were asking about how to save those points into an array. It may just be easiest to use x/y coordinates into a PVector and save into an arraylist - see https://forum.processing.org/one/topic/how-to-use-arraylist.html. Or just read up on some of the tutorials and examples at processing.org (appreciate you are new to this, but if you are serious about actually learning processing, you'll do better in the long run if you start looking at examples and trying to make things, rather than asking others to solve all your problems).
Sorry if my actions seemed like that, but its the opposite, i created a new post because what i said i wasn't very explicite and you said something that it was exactly what i wanted but i said it wrong, so i created a new post, i m serious about processing and i just couldn't figure it out so i' m sorry about my actions but it really wasn't my intention. And thank you
} }
this is the code that i made till far, without asking anything, searched a theory that i really liked about Fibonacci and made a watchface based on that theory.
Hopefully wasn't being rude. Just trying to say that sometimes you learn more with a bit of reading and trial and error, rather than just getting a complete answer. Looks like you are making good progress. if you wanted to see the spiral, you could add something like: