float xmag, ymag = 0; float newXmag, newYmag = 0; float m = 0; float n = 0; float r; float r1; float t; void setup() { size(1280, 720, P3D); noStroke(); colorMode(RGB, 1); } void draw() { background(0.5); pushMatrix(); translate(width/2, height/2, 300 m); newXmag = mouseX/float(width) * TWO_PI; newYmag = mouseY/float(height) * TWO_PI; float diff = xmag-newXmag; if (abs(diff) > ) { xmag -= diff/4.0; } diff = ymag-newYmag; if (abs(diff) > ) { ymag -= diff/4.0; } rotateX(-ymag 20*m); rotateY(-xmag n r1); scale(90); beginShape(QUADS); fill(0, m, 1); vertex(-1, 1, 1); fill(1, 1, m); vertex( 1, 1, 1); fill(m, 0, 1); vertex( 1, -1, 1); fill(0, 0, n); vertex(-1, -1, 1); fill(1, n, m); vertex( 1, 1, 1); fill(1, m, 0); vertex( 1, 1, -1); fill(m, 0, 0); vertex( 1, -1, -1); fill(n, 0, 1); vertex( 1, -1, 1); fill(m, 1, 0); vertex( 1, 1, -1); fill(0, m, n); vertex(-1, 1, -1); fill(0, 0, 0
Hide player controls
Hide resume playing