Skip to content

Instantly share code, notes, and snippets.

@KrabCode
Last active May 12, 2023 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KrabCode/785c62a4c111544fad6ae115f8926d4e to your computer and use it in GitHub Desktop.
Save KrabCode/785c62a4c111544fad6ae115f8926d4e to your computer and use it in GitHub Desktop.
void setup() {
size(600, 300);
}
void draw() {
textAlign(CENTER, BOTTOM);
translate(width/2, height*0.8);
background(36);
fill(255);
textSize(22);
text("horizon", 0, 0);
textSize(32);
float t = radians(frameCount);
pushMatrix();
rotate(t);
pushMatrix();
translate(150, 0);
rotate(-t);
text("sun", 0, 0);
popMatrix();
pushMatrix();
translate(-150, 0);
rotate(-t);
text("moon", 0, 0);
popMatrix();
popMatrix();
pushMatrix();
textSize(26);
translate(250, -20);
rotate(-HALF_PI);
fill(36);
noStroke();
rectMode(CENTER);
fill(255);
text("tree", 0, 0);
textSize(32);
text("tree", 5, 30);
popMatrix();
rectMode(CORNER);
stroke(255);
fill(36);
rect(-500, 0, 1000, 1000);
fill(255);
textSize(18);
float daytime = 2*((-PI+t)%TAU)/TAU;
float rabbitX = -0.5+(daytime);
float rabbitY = -abs(sin(rabbitX*30));
text("rabbit", rabbitX*width*1.2, 50+rabbitY*15);
float starAlpha = 0.3+0.7*sin(t);
fill(255,starAlpha*255);
text("star", -120, -180);
text("star", 125, -160);
text("star", -205, -120);
if (frameCount < 360) {
//save("out3/"+frameCount+".jpg");
}
}
@KrabCode
Copy link
Author

ezgif-5-db8e9c3ab0

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