Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int angle = 0;
- void setup() {
- size (1200, 1200);
- pixelDensity(1);
- frameRate(60);
- background (0);
- smooth();
- for (int i=0; i<100; i++){
- float c = random (100,255);
- float t = random(100, 255);
- fill(c,t);
- float x= random (0, width);
- float y= random (0, height);
- float s = random(1, 10);
- ellipse (x, y, s, s);
- }
- // rectMode(CENTER);
- }
- void draw () {
- pushMatrix();
- translate (mouseX, mouseY);
- rotate(radians( angle ));
- drawCube ();
- popMatrix();
- drawStars(0, 0, 255);
- angle = angle + 1;
- // drawCube ();
- }
- void drawCube () {
- fill (240);
- rect (100, 50, 300, 300);
- fill( 200);
- rect (125, 75, 250, 250);
- fill (150);
- rect (150, 100, 200, 200);
- fill (100);
- rect ( 175, 125, 150, 150);
- fill (75);
- rect (200, 150, 100, 100);
- fill (50);
- rect (225, 175, 50, 50);
- line( 100, 50, 50, 100);
- line(50, 100, 50, 400);
- line(50, 400, 350, 400);
- line (350, 400, 350, 100);
- line(350, 100, 50, 100);
- line (350, 100, 400, 50);
- line (350, 400, 400, 350);
- line (50, 400, 100, 350);
- fill(150);
- quad (100, 50, 50, 100, 50, 400, 100, 350);
- fill (100);
- quad(100, 350, 50, 400, 350, 400, 400, 350);
- fill (50);
- quad (100, 360, 75, 390, 350, 390, 375, 360);
- fill (120);
- quad ( 100, 370, 90, 380, 345, 380, 355, 370);
- fill (90);
- quad (90, 70, 60, 100, 60, 375, 90, 345);
- fill(30);
- quad (80, 95, 70, 110, 70, 325, 80, 310);
- }
- void drawStars( int x, int y, color c ) {
- pushMatrix();
- translate(x, y);
- fill(c);
- beginShape();
- ellipse( 50,50, 10,10);
- endShape();
- popMatrix();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement