Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// ND Lemniscate rainbow curve in Processing: https://processing.org/
int iterations = 360;
int alphaDelta = 40;
int saturation = 170;
void setup(){
size(800, 600);
noStroke();
colorMode(HSB);
background(180);
}
void draw(){
float x = sin(radians(frameCount));
float y = sin(radians(frameCount)) * cos(radians(frameCount));
if(frameCount < iterations){
fill(map(frameCount, 0, iterations, 0, 255), saturation, 255);
}else{
alphaDelta += 10;
fill(map(frameCount-iterations, 0, iterations, 0, 255), saturation, 255, 255 - alphaDelta);
}
translate(width/2, height/2);
ellipse(x * 275, y * 205, 75, 75);
if (frameCount == iterations + 30){
noLoop();
}
}
@fiskurgit
Copy link
Author

fiskurgit commented Aug 19, 2019

Screen Shot 2019-08-19 at 16 22 33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment