Skip to content

Instantly share code, notes, and snippets.

@atduskgreg
Created November 15, 2011 18:47
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 atduskgreg/1367940 to your computer and use it in GitHub Desktop.
Save atduskgreg/1367940 to your computer and use it in GitHub Desktop.
basic 3d rectangle in processing
float z;
void setup()
{
size(500,500, P3D);
z = 0;
}
void draw()
{
background(255);
translate(width/2, height/2, z);
rect(0, 0, 50, 50);
}
void mouseMoved(){
z = map(mouseX, 0, width, 0, 500);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment