//ya...fuckin-cool idea workin here ;) //questions for daniel= //how to attach obj to moving ellispe //how to stagger the multi-matrix ellispes //why isn't sound clip playing //how does serial port work //import processing.opengl.*; // .OBJ Loader // by SAITO // Created 20 April 2005 import saito.objloader.*; OBJModel model; float rotX; float rotY; int i=10; void setup() { avoidSetup(); size(400, 700, P3D); frameRate(30); model = new OBJModel(this); model.debugMode(); model.load("text_blob.obj"); } void draw() { //background(0); avoidDraw(); lights(); //translate(50,50); pushMatrix(); translate(mouseX, mouseY, 0); //translate(posX[i], posY[i],0); rotateX(radians(i++)*5); //change rotations rotY rotateY(rotX); scale(5.0); model.draw(); popMatrix(); translate(100,50); pushMatrix(); //translate(mouseX, mouseY, 0); rotateX(radians(i++)*2); //change rotations rotY rotateY(rotX); scale(40.0); model.draw(); popMatrix(); } // controls------------------------------------------------------------ boolean bTexture = true; boolean bStroke = true; void keyPressed(){ if(key == 't'){ if(!bTexture){ model.enableTexture(); bTexture = true; } else { model.disableTexture(); bTexture = false; } } if(key == 's'){ if(!bStroke){ stroke(10, 10, 10, 100); bStroke = true; } else { noStroke(); bStroke = false; } } else if(key=='1') model.drawMode(POINTS); else if(key=='2') //model.drawMode(LINE_LOOP); // else if(key=='3') model.drawMode(TRIANGLES); else if(key=='4') model.drawMode(POLYGON); } //---------------------------------------------------------------------------- /* void mouseDragged() { rotX = mouseX;//+= (mouseX - pmouseX) * 0.01; rotY = mouseY;//-= (mouseY - pmouseY) * 0.01; }*/