import processing.opengl.*; //import processing.opengl.*; // .OBJ Loader // by SAITO // Placing a virtual structure represented as mathematically // three-dimensional object. // SModel.load() reads structure data of the object stored // as numerical data. // SModel.draw() gives a visual form to the structure data. // processing standard drawing functions can be used to manipulate // the visual form to create deep visual experiences. // Created 20 April 2005 import saito.objloader.*; OBJModel model; float rotX; float rotY; void setup() { size(500, 500, OPENGL); frameRate(30); model = new OBJModel(this); model.load("wiimote.obj"); model.enableTexture(); model.drawMode(TRIANGLES); } void draw() { background(0); lights(); ambientLight(230, 230, 230); pushMatrix(); translate(width/2, height/2, 0); rotateX(sin(frameCount*0.01)*TWO_PI); rotateY(sin(frameCount*0.02)*TWO_PI); rotateZ(sin(frameCount*0.03)*TWO_PI); // the model is inverted (don't know why) scale(-0.5); noStroke(); model.draw(); popMatrix(); }