X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=UIImplementation.pde;h=0f73b99aaa3a3839b5ebf06e72c0ba72d24de0fa;hb=3ffd6241fa4f38d82cdb4dca434ca04b1edc9ccd;hp=c3f08972df25f509a753d8738aab44c83f06257d;hpb=b5d6d7a0a56238e37d648489a1d95bb1dc351091;p=SugarCubes.git diff --git a/UIImplementation.pde b/UIImplementation.pde index c3f0897..0f73b99 100644 --- a/UIImplementation.pde +++ b/UIImplementation.pde @@ -83,17 +83,20 @@ FloatBuffer vertData; long simulationStart = System.nanoTime(); if (simulationOn) { + hint(DISABLE_DEPTH_TEST); drawSimulation(simulationColors); + hint(ENABLE_DEPTH_TEST); } 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.); + drawBox(0, -TRAILER_HEIGHT, 0, 0, 0, 0, TRAILER_WIDTH, TRAILER_HEIGHT, TRAILER_DEPTH, TRAILER_HEIGHT/2.); fill(#070707); stroke(#222222); beginShape(); @@ -136,7 +139,8 @@ FloatBuffer vertData; pgl.vertexAttribPointer(vertLoc, 3, PGL.FLOAT, false, 7 * SIZEOF_FLOAT, 0); pgl.vertexAttribPointer(colorLoc, 4, PGL.FLOAT, false, 7 * SIZEOF_FLOAT, 3 * SIZEOF_FLOAT); - + javax.media.opengl.GL2 gl2 = (javax.media.opengl.GL2) ((PJOGL)pgl).gl; + gl2.glPointSize(2f); pgl.drawArrays(PGL.POINTS, 0, nvert); pgl.disableVertexAttribArray(vertLoc); @@ -179,7 +183,7 @@ FloatBuffer allocateDirectFloatBuffer(int n) { float in = .15; noStroke(); fill(#393939); - //drawBox(c.x+in, c.y+in, c.z+in, c.rx, c.ry, c.rz, Cube.EDGE_WIDTH-in*2, Cube.EDGE_HEIGHT-in*2, Cube.EDGE_WIDTH-in*2, Cube.CHANNEL_WIDTH-in); + // drawBox(c.x+in, c.y+in, c.z+in, c.rx, c.ry, c.rz, Cube.EDGE_WIDTH-in*2, Cube.EDGE_HEIGHT-in*2, Cube.EDGE_WIDTH-in*2, Cube.CHANNEL_WIDTH-in); } void drawBox(float x, float y, float z, float rx, float ry, float rz, float xd, float yd, float zd, float sw) {