Skip to content

Instantly share code, notes, and snippets.

@milligramme
Created September 18, 2015 15:45
Show Gist options
  • Select an option

  • Save milligramme/31728cb2056facc5d409 to your computer and use it in GitHub Desktop.

Select an option

Save milligramme/31728cb2056facc5d409 to your computer and use it in GitHub Desktop.
float rx,ry = 0;
void setup() {
size(screen.width, screen.height, P3D);
colorMode(HSB,360,100,100);
smooth();
frameRate(30);
}
void draw() {
background(360*mouseX/width,80,100*mouseY/height);
translate(width/2,height/2,0);
strokeWeight(2);
stroke(255);
rotateX(rx);
rotateY(ry);
noFill();
box(130);
rx+= PI * max(0.1, mouseX/width);
ry+= PI * max(0.1, mouseY/height);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment