diff --git a/android/examples/OpenGL/Performance/CubicGridImmediate/CubicGridImmediate.pde b/android/examples/OpenGL/Performance/CubicGridImmediate/CubicGridImmediate.pde index 7df929a86..1faa0bcb4 100644 --- a/android/examples/OpenGL/Performance/CubicGridImmediate/CubicGridImmediate.pde +++ b/android/examples/OpenGL/Performance/CubicGridImmediate/CubicGridImmediate.pde @@ -6,7 +6,7 @@ * and popMatrix() functions. */ -float boxSize = 40; +float boxSize = 50; float margin = boxSize*2; float depth = 400; color boxFill; @@ -19,6 +19,7 @@ void setup() { size(640, 360, P3D); orientation(LANDSCAPE); frameRate(60); + noSmooth(); noStroke(); } diff --git a/android/examples/OpenGL/Performance/CubicGridRetained/CubicGridRetained.pde b/android/examples/OpenGL/Performance/CubicGridRetained/CubicGridRetained.pde index 5caf462a2..dbc715815 100644 --- a/android/examples/OpenGL/Performance/CubicGridRetained/CubicGridRetained.pde +++ b/android/examples/OpenGL/Performance/CubicGridRetained/CubicGridRetained.pde @@ -1,4 +1,4 @@ -float boxSize = 40; +float boxSize = 50; float margin = boxSize*2; float depth = 400; color boxFill; @@ -13,6 +13,7 @@ void setup() { size(640, 360, P3D); orientation(LANDSCAPE); frameRate(60); + noSmooth(); noStroke(); grid = createShape(PShape.GROUP); @@ -23,62 +24,10 @@ void setup() { for (float k =- width+margin; k <= width-margin; k += boxSize){ // Base fill color on counter values, abs function // ensures values stay within legal range - boxFill = color(abs(i), abs(j), abs(k), 50); - - PShape cube = createShape(QUADS); - cube.noStroke(); + boxFill = color(abs(i), abs(j), abs(k), 50); + PShape cube = createShape(BOX, boxSize, boxSize, boxSize); cube.fill(boxFill); - - float w = boxSize; - float h = boxSize; - float d = boxSize; - float shiftX = k; - float shiftY = j; - float shiftZ = i; - - // Front face - cube.normal(0, 0, 1); - cube.vertex(-w/2 + shiftX, -h/2 + shiftY, -d/2 + shiftZ); - cube.vertex(+w/2 + shiftX, -h/2 + shiftY, -d/2 + shiftZ); - cube.vertex(+w/2 + shiftX, +h/2 + shiftY, -d/2 + shiftZ); - cube.vertex(-w/2 + shiftX, +h/2 + shiftY, -d/2 + shiftZ); - - // Back face - cube.normal(0, 0, -1); - cube.vertex(-w/2 + shiftX, -h/2 + shiftY, +d/2 + shiftZ); - cube.vertex(+w/2 + shiftX, -h/2 + shiftY, +d/2 + shiftZ); - cube.vertex(+w/2 + shiftX, +h/2 + shiftY, +d/2 + shiftZ); - cube.vertex(-w/2 + shiftX, +h/2 + shiftY, +d/2 + shiftZ); - - // Left face - cube.normal(1, 0, 0); - cube.vertex(-w/2 + shiftX, -h/2 + shiftY, -d/2 + shiftZ); - cube.vertex(-w/2 + shiftX, -h/2 + shiftY, +d/2 + shiftZ); - cube.vertex(-w/2 + shiftX, +h/2 + shiftY, +d/2 + shiftZ); - cube.vertex(-w/2 + shiftX, +h/2 + shiftY, -d/2 + shiftZ); - - // Right face - cube.normal(-1, 0, 0); - cube.vertex(+w/2 + shiftX, -h/2 + shiftY, -d/2 + shiftZ); - cube.vertex(+w/2 + shiftX, -h/2 + shiftY, +d/2 + shiftZ); - cube.vertex(+w/2 + shiftX, +h/2 + shiftY, +d/2 + shiftZ); - cube.vertex(+w/2 + shiftX, +h/2 + shiftY, -d/2 + shiftZ); - - // Top face - cube.normal(0, 1, 0); - cube.vertex(-w/2 + shiftX, -h/2 + shiftY, -d/2 + shiftZ); - cube.vertex(+w/2 + shiftX, -h/2 + shiftY, -d/2 + shiftZ); - cube.vertex(+w/2 + shiftX, -h/2 + shiftY, +d/2 + shiftZ); - cube.vertex(-w/2 + shiftX, -h/2 + shiftY, +d/2 + shiftZ); - - // Bottom face - cube.normal(0, -1, 0); - cube.vertex(-w/2 + shiftX, +h/2 + shiftY, -d/2 + shiftZ); - cube.vertex(+w/2 + shiftX, +h/2 + shiftY, -d/2 + shiftZ); - cube.vertex(+w/2 + shiftX, +h/2 + shiftY, +d/2 + shiftZ); - cube.vertex(-w/2 + shiftX, +h/2 + shiftY, +d/2 + shiftZ); - - cube.end(); + cube.translate(k, j, i); grid.addChild(cube); } }