//import processing.opengl.*; import processing.video.*; import proxml.*; int stepZ = 90; int zoomZ = -1160; int zoomZspeed= 40; boolean connectNodes = true; XMLElement eyePathXML; XMLInOut xmlInOut; Movie rearWindow; MovieMaker mm; // Declare MovieMaker object //font settings PFont font; PFont fontA; Visuals v; void setup() { size(1000, 768, P3D); frameRate(30); rearWindow = new Movie(this, "rwuncompressed.mov"); //uncompressed is cut at 1:40:00 rearWindow.loop(); mm = new MovieMaker(this, width, height, "screenCapture.mov", 20, MovieMaker.RAW, MovieMaker.LOSSLESS); background(0,0,0); lights(); fill(255,0,0,60); //stroke(255, 0, 0,40); noStroke(); //font settings fontA = loadFont("Swiss721BT-RomanCondensed-48.vlw"); textFont(fontA, 25); v= new Visuals(rearWindow); //-----------------------------------------------------------XML stuff xmlInOut = new XMLInOut(this); try{ xmlInOut.loadElement("sinan.xml"); } catch(Exception e){ //if the xml file could not be loaded it has to be created eyePathXML = new XMLElement("eyePath"); } //pushMatrix(); translate(width/2, height,0); } XMLElement position; int prevX=-1; void draw() { background(255); translate(width/2, height,0); /* float cameraY = height/2.0; float fov = zoomZ/float(width) * PI/2; float cameraZ = cameraY / tan(fov / 2.0); float aspect = float(width)/float(height); perspective(fov, aspect, cameraZ/10.0, cameraZ*10.0); println(zoomZ); translate(0, 0, 0); rotateX((width/2-mouseY)/float(height) * PI); // rotateY((width/2-mouseY)/float(height) * PI); */ camera(0, -100, -zoomZ, -(width/2-mouseX)*10, -(height/2-mouseY)*10,- eyePathXML.countChildren()*(stepZ+20), 0.0, 1.0, 0.0); rectMode(CENTER); noFill(); stroke(255,255,255,255); rect(0, 0, 720, 480); int videoZ=0; if(zoomZ>-840){ videoZ=-zoomZ-840; } //println(zoomZ); v.displayVideo(videoZ, (zoomZ+1170)/3); fill(255,0,0,100); noStroke(); translate(-720,0,0); beginShape(); for(int i = 0; i < eyePathXML.countChildren();i++){ position = eyePathXML.getChild(i); int x = position.getIntAttribute("x"); int y = position.getIntAttribute("y"); int z = position.getIntAttribute("z"); y = 0; //to be deleted later //ellipse(x, 0,20,20); if (prevX!=-1&&connectNodes==true){ stroke(255,0,0,80); line(x, y, -stepZ, prevX, y, 0); curveVertex(x, y, z); noStroke(); } translate(0, 0, -stepZ); //v.displayNode(x,0,z); if(zoomZ+600