Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float x, y, org_x, org_y;
- float theta, diam_sun, orbit_moon, diam_moon, radius;
- color bg = #100315;
- color f = #FCFCFC;
- void setup() {
- size(500, 500);
- background(bg);
- noStroke();
- org_x = width/2;
- org_y = height/2;
- diam_sun = 150;
- diam_moon = diam_sun*.95;
- orbit_moon = diam_sun - diam_moon ;
- radius = orbit_moon/2 + 3;
- }
- void draw() {
- background(bg);
- fill(f);
- ellipse(org_x, org_y, diam_sun, diam_sun);
- fill(bg);
- x = org_x + sin(theta)*radius;
- y = org_y + cos(theta)*radius;
- ellipse(x, y, diam_moon, diam_moon);
- theta += 0.0523;
- if (frameCount % 4 == 0 && frameCount <121) saveFrame("image-####.gif");
- }
Advertisement
Add Comment
Please, Sign In to add comment