//"Sagittarius A: Our galexy's black hole" //by AnnMarie Cernoch 2007 //http://www.spacetoday.org/DeepSpace/Stars/BlackHoles/MilkyWayBlackHoles.html (center of Milky Way maybe a super blackhole) //http://www.space.com/scienceastronomy/blackhole_note_030909.html (blackholes emit B-flat sounds)noon // based on: .OBJ Loader transformation // by SAITO import saito.objloader.*; import krister.Ess.*; PImage pic; AudioChannel myChannel; AudioChannel myChannel2; OBJModel model; OBJModel blob_model; OBJModel tmpmodel; //float rotX; float xTrans, yTrans; int a; int j; void setup() { size(600, 600, P3D); frameRate(30); //sound---------------------------------------------------------------------- Ess.start(this); myChannel2 = new AudioChannel("sound1.aif"); myChannel = new AudioChannel("static_sound.aif"); //models-------------------------------------------------------------------- model = new OBJModel(this); blob_model = new OBJModel(this); tmpmodel = new OBJModel(this); model.debugMode(); model.load("blackhole3.obj"); blob_model.load("text_blob.obj"); tmpmodel.load("blackhole3.obj"); //background picture--------------------------------------------------------- pic = loadImage("stars_600.jpg"); flockSetup(); } void draw() { background(pic); lights(); flockDraw(); myChannel.play(Ess.FOREVER); pushMatrix(); rotateX(100); translate(width/2, height/2+250, -10); rotateY(radians(a++)*-1); //rotateY(rotX); scale(20.0); noStroke(); // renders the temporary model tmpmodel.draw(); //Users are identified by rotating objects. here pushMatrix(); xTrans = mouseX/25-10; //use these to expand mouse plane yTrans = mouseY/25-9; //AMnum array translate(xTrans,-1.5,yTrans); blob(); popMatrix(); popMatrix(); manipulate(); } void blob(){ rotate(radians(a++)); scale(.5); blob_model.draw(); myChannel2.play(1); } void manipulate(){ for(int i = 0; i < model.getVertexsize(); i++){ Vertex orgv = model.getVertex(i); Vertex tmpv = new Vertex(); tmpv.vx = orgv.vx; tmpv.vy = -dist(orgv.vx, orgv.vz, xTrans, yTrans)/-3; //change this number to change the pull on plane tmpv.vz = orgv.vz; tmpmodel.setVertex(i, tmpv); } } void stop() { Ess.stop(); super.stop(); } //this is for debugging only /* void mouseDragged() { rotX -= (mouseY - pmouseY) * 0.01; } */ // OBJModel.getVertex() allows accessing to each vertex // OBJModel.setVertex() allows transformation of a model