This program displays a white 3D box, which will rotate as the mouse cursor is moved across its screen.

This browser does not have a Java Plug-in.
Get the latest Java Plug-in here.

Built with Processing

Code void setup() { size(255,255,P3D); } void draw() { background(0); lights(); noStroke(); translate(128,128); rotateY(float(mouseX) / float(width) * PI); rotateZ(float(mouseY)/float(height) * -PI); box(50,50,50); }