// A new variable, for gravity (i.e. acceleration). // We use a relatively small number (0.1) because this accelerations accumulates over time, increasing the speed. // Try changing this number to 2.0 and see what happens. PFont fontA; float w=100; float angleX=0; float angleY=0; float angleZ=0; float theta=0.01; int mouseX_old; int mouseY_old; int i, j; void setup() { size(600,600,P3D); smooth(); fontA = loadFont("ComicSansMS-Bold-32.vlw"); textAlign(CENTER); textFont(fontA, 8); } void draw() { background(200); fill(0); rectMode(CENTER); pushMatrix(); translate(width/2, height/2, 0); rotateX(angleY); rotateY(angleX); rotateZ(angleZ); scale(1); stroke(200,100,100); for(i=(int)-w; i