Created
November 15, 2011 19:13
-
-
Save atduskgreg/1368012 to your computer and use it in GitHub Desktop.
3d with inner rotation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float z; | |
float r = 0; | |
void setup() | |
{ | |
size(500, 500, P3D); | |
z = 0; | |
} | |
void draw() | |
{ | |
background(255); | |
translate(mouseX, mouseY); | |
pushMatrix(); | |
r++; | |
rotateY(radians(r)); | |
translate(-25, -25); | |
rect(-25, -25, 50, 50); | |
ellipse(0, 0, 50, 50); | |
rotateY(radians(90)); | |
rect(0, 0, 50, 50); | |
popMatrix(); | |
} | |
void mouseMoved() { | |
z = map(mouseX, 0, width, 0, 360); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment