Oh all my code does is create a 16x16x16 cube that is hollow, for example
if ((y == size.y - 1) || (blockID[x][y + 1][z] == 0)) {
vertexArray.add(new float[] { pos2.x, pos2.y, pos1.z, pos1.x, pos2.y, pos1.z, pos1.x, pos2.y, pos2.z, pos2.x, pos2.y, pos2.z });
colourArray.add(new float[] { colour.x, colour.y, colour.z, colour.w, colour.x, colour.y, colour.z, colour.w, colour.x, colour.y, colour.z, colour.w, colour.x, colour.y, colour.z, colour.w });
}
if ((y == 0) || (blockID[x][y - 1][z] == 0)) {
vertexArray.add(new float[] { pos2.x, pos1.y, pos2.z, pos1.x, pos1.y, pos2.z, pos1.x, pos1.y, pos1.z, pos2.x, pos1.y, pos1.z });
colourArray.add(new float[] { colour.x, colour.y, colour.z, colour.w, colour.x, colour.y, colour.z, colour.w, colour.x, colour.y, colour.z, colour.w, colour.x, colour.y, colour.z, colour.w });
}
This checks if the block is the
- max edge block or if the block above is air, if so render top view
- min edge block or if the block below is air, if so render top view
This is then repeated to create a block that is only rendering the sides that are needed