jlindstroem
YaBB Newbies
Offline
Posts: 2
problem with 3D and camera
Jun 24th , 2009, 4:43am
I'm programming a sound equalizer for a university project, see code below. the code below is a sketch at 1024x640 where everything works fine. But the final project needs to be 6144x640 and I then get the problem that it puts the start of the equalizer in the middle of the screen, whereas I need it to start on the left side. When putting a simple offset value I can get it to the left side but it looks totally different due to camera settings/distortion... What I basically need is the equalizer to look exactly like the one in my 1024px sketch, but on the left side of the 6144px sketch! can anybody help me with my camera settings, or is there an easier way to achieve the look? thanks for your help! here is the code, it reacts to audio input, so plug in a mic and leave some music running... _____________ import ddf.minim.*; Minim minim; AudioInput in; float randomhue; void setup () { size(1024, 640, P3D); background(0); colorMode(HSB, 500, 100, 100); minim = new Minim(this); minim.debugOn(); // get a line in from Minim, default bit depth is 16 in = minim.getLineIn(Minim.MONO, 96); } void draw(){ camera(140.0, 420.0, 120.0, 150.0, 150.0, 0.0, 0.0, 1.0, 0.0); background(0); /* if(frameCount % 100 == 0){ randomhue = random(500); } stroke(random(randomhue,randomhue-20),50,75, 30); */ for (int i=1; i < in.mix.level()*500; i = i+1) { for(int j=0; j < 30; j = j+1){ for(int k = 0; k < in.bufferSize() - 1; k++) { stroke(i*in.mix.get(k+1)*100,75,(k+1)*4, 50); point(i*10, j*5, in.mix.get(k+1)*400); } } } } void stop() { // always close Minim audio classes when you are done with them in.close(); minim.stop(); super.stop(); } _________________