Object[] myElements; XMLElement xml; int currX = 0; float currY = -200; int currZ = 0; String tempText = ""; float counter = 0; float xmag, ymag = 0; float newXmag, newYmag = 0; float boxSize = 0; void setup(){ size(640,480); background(255); //noStroke(); // fill(212); //lights(); //smooth(); sphereDetail(1); textFont(loadFont("Meta-Bold.vlw.gz"),24); xml = new XMLElement(); String xmlString=""; String[] lines=loadStrings("moredirs.xml"); for(int i=0; i 0.01) { xmag -= diff/4.0; } diff = ymag-newYmag; if (abs(diff) > 0.01) { ymag -= diff/4.0; } rotateX(-ymag); rotateY(-xmag); translate(currX,currY,currZ); translate(sin(currY/40)*50,0,cos(currY/40)*50); if(node.getName().equals("file") ){ push(); translate(0,boxSize/2000,0); // float boxSize = Float.parseFloat((String)node.getAttribute("size")); float boxSize = 15000; if(boxSize<5000) boxSize = 15000; rect(0,0,boxSize/1000,boxSize/1000);//boxSize/1000); rotateY(xmag); rotateX(ymag); text((String)node.getAttribute("name"),boxSize/1000,5); currY+=(boxSize/700); pop(); } else { push(); translate(0,boxSize/2000,0); float boxSize = 15000; box(boxSize/1000); rotateY(xmag); rotateX(ymag); text((String)node.getAttribute("name"),boxSize/1000,5); currY+=(boxSize/1000); pop(); } pop(); } counter++; currY = -200; } void mouseDragged(){ newXmag = TWO_PI - mouseX/float(width) * TWO_PI + PI; newYmag = TWO_PI - mouseY/float(height) * TWO_PI + PI; }