+int nvert = 200000;
+int SIZEOF_INT = Integer.SIZE / 8;
+int SIZEOF_FLOAT = Float.SIZE / 8;
+
+PGL pgl;
+PShader sh;
+
+int vertLoc;
+int colorLoc;
+
+IntBuffer vboName;
+FloatBuffer vertData;
+
+ boolean initted = false;
+ PShape sha1;
+ int numPoints = 10000;
+
+ void initme()
+ {
+ nvert = model.points.size();
+ sh = loadShader("frag.glsl", "vert.glsl");
+ /*color[] simulationColors = lx.getColors();
+ sha1= createShape();
+ sha1.beginShape(POINTS);
+ for (LXPoint p : model.points) {
+ stroke(simulationColors[p.index]);
+ //pointColor(simulationColors[p.index]);
+ gl2.glPointColor=100;
+ sha1.vertex(p.x, p.y, p.z);
+ }
+ sha1.endShape();*/
+ float[] temp = new float[nvert * 7];
+ for (LXPoint p : model.points) {
+ // position
+ temp[p.index * 7 + 0] = p.x;
+ temp[p.index * 7 + 1] = p.y;
+ temp[p.index * 7 + 2] = p.z;
+
+ // color
+ temp[p.index * 7 + 3] = 0.0;
+ temp[p.index * 7 + 4] = 0.0;
+ temp[p.index * 7 + 5] = 0.0;
+ temp[p.index * 7 + 6] = 1.0;
+ }
+
+ vertData = allocateDirectFloatBuffer(nvert * 7);
+ vertData.rewind();
+ vertData.put(temp);
+ vertData.position(0);
+ vboName = allocateDirectIntBuffer(1);
+ initVBO();
+ }
+ void onDraw(UI ui) {
+ if(!initted)
+ {
+ initted=true;
+ initme();
+ }
+ color[] simulationColors = lx.getColors();
+ String displayMode = uiCrossfader.getDisplayMode();
+ if (displayMode == "A") {
+ simulationColors = lx.engine.getDeck(LEFT_DECK).getColors();
+ } else if (displayMode == "B") {
+ simulationColors = lx.engine.getDeck(RIGHT_DECK).getColors();
+ }
+
+ long simulationStart = System.nanoTime();
+ if (simulationOn) {
+ drawSimulation(simulationColors);
+ }
+ simulationNanos = System.nanoTime() - simulationStart;
+ camera();
+ strokeWeight(1);
+ }
+ void drawSimulation(color[] simulationColors) {
+ translate(0, 30, 0);
+
+ fill(#141414);
+ //drawBox(0, -TRAILER_HEIGHT, 0, 0, 0, 0, TRAILER_WIDTH, TRAILER_HEIGHT, TRAILER_DEPTH, TRAILER_HEIGHT/2.);
+ fill(#070707);
+ stroke(#222222);
+ beginShape();
+ vertex(0, 0, 0);
+ vertex(TRAILER_WIDTH, 0, 0);
+ vertex(TRAILER_WIDTH, 0, TRAILER_DEPTH);
+ vertex(0, 0, TRAILER_DEPTH);
+ endShape();