Yeah the comments are wrong i forgot to update them
Here is how i make a cube
public static HawkMesh createCube() {
if(cube == null){
List<Float> vertices = new ArrayList<Float>();
List<Float> normals = new ArrayList<Float>();
List<Float> textureCoords = new ArrayList<Float>();
List<Short> indices = new ArrayList<Short>();
// Face
indices.add((short) (vertices.size() / 3 + 0));
indices.add((short) (vertices.size() / 3 + 1));
indices.add((short) (vertices.size() / 3 + 2));
indices.add((short) (vertices.size() / 3 + 2));
indices.add((short) (vertices.size() / 3 + 3));
indices.add((short) (vertices.size() / 3 + 0));
addVertex(1, 0, 0, vertices);
addVertex(1, 1, 0, vertices);
addVertex(0, 1, 0, vertices);
addVertex(0, 0, 0, vertices);
addNormals(0, 0, 1, normals);
addNormals(0, 0, 1, normals);
addNormals(0, 0, 1, normals);
addNormals(0, 0, 1, normals);
addTextureCoords(0, 0, textureCoords);
addTextureCoords(1, 0, textureCoords);
addTextureCoords(1, 1, textureCoords);
addTextureCoords(0, 1, textureCoords);
// Back
indices.add((short) (vertices.size() / 3 + 2));
indices.add((short) (vertices.size() / 3 + 1));
indices.add((short) (vertices.size() / 3 + 0));
indices.add((short) (vertices.size() / 3 + 0));
indices.add((short) (vertices.size() / 3 + 3));
indices.add((short) (vertices.size() / 3 + 2));
addVertex(1, 0, -1, vertices);
addVertex(1, 1, -1, vertices);
addVertex(0, 1, -1, vertices);
addVertex(0, 0, -1, vertices);
addNormals(0, 0, 1, normals);
addNormals(0, 0, 1, normals);
addNormals(0, 0, 1, normals);
addNormals(0, 0, 1, normals);
addTextureCoords(0, 0, textureCoords);
addTextureCoords(1, 0, textureCoords);
addTextureCoords(1, 1, textureCoords);
addTextureCoords(0, 1, textureCoords);
// Left
indices.add((short) (vertices.size() / 3 + 2));
indices.add((short) (vertices.size() / 3 + 1));
indices.add((short) (vertices.size() / 3 + 0));
indices.add((short) (vertices.size() / 3 + 0));
indices.add((short) (vertices.size() / 3 + 3));
indices.add((short) (vertices.size() / 3 + 2));
addVertex(0, 0, 0, vertices);
addVertex(0, 0, -1, vertices);
addVertex(0, 1, -1, vertices);
addVertex(0, 1, 0, vertices);
addNormals(-1, 0, 0, normals);
addNormals(-1, 0, 0, normals);
addNormals(-1, 0, 0, normals);
addNormals(-1, 0, 0, normals);
addTextureCoords(0, 0, textureCoords);
addTextureCoords(1, 0, textureCoords);
addTextureCoords(1, 1, textureCoords);
addTextureCoords(0, 1, textureCoords);
// Right
indices.add((short) (vertices.size() / 3 + 0));
indices.add((short) (vertices.size() / 3 + 1));
indices.add((short) (vertices.size() / 3 + 2));
indices.add((short) (vertices.size() / 3 + 2));
indices.add((short) (vertices.size() / 3 + 3));
indices.add((short) (vertices.size() / 3 + 0));
addVertex(1, 0, 0, vertices);
addVertex(1, 0, -1, vertices);
addVertex(1, 1, -1, vertices);
addVertex(1, 1, 0, vertices);
addNormals(1, 0, 0, normals);
addNormals(1, 0, 0, normals);
addNormals(1, 0, 0, normals);
addNormals(1, 0, 0, normals);
addTextureCoords(0, 0, textureCoords);
addTextureCoords(1, 0, textureCoords);
addTextureCoords(1, 1, textureCoords);
addTextureCoords(0, 1, textureCoords);
// Bottom
indices.add((short) (vertices.size() / 3 + 0));
indices.add((short) (vertices.size() / 3 + 1));
indices.add((short) (vertices.size() / 3 + 2));
indices.add((short) (vertices.size() / 3 + 2));
indices.add((short) (vertices.size() / 3 + 3));
indices.add((short) (vertices.size() / 3 + 0));
addVertex(0, 0, 0, vertices);
addVertex(0, 0, -1, vertices);
addVertex(1, 0, -1, vertices);
addVertex(1, 0, 0, vertices);
addNormals(0, -1, 0, normals);
addNormals(0, -1, 0, normals);
addNormals(0, -1, 0, normals);
addNormals(0, -1, 0, normals);
addTextureCoords(0, 0, textureCoords);
addTextureCoords(1, 0, textureCoords);
addTextureCoords(1, 1, textureCoords);
addTextureCoords(0, 1, textureCoords);
// Top
indices.add((short) (vertices.size() / 3 + 2));
indices.add((short) (vertices.size() / 3 + 1));
indices.add((short) (vertices.size() / 3 + 0));
indices.add((short) (vertices.size() / 3 + 0));
indices.add((short) (vertices.size() / 3 + 3));
indices.add((short) (vertices.size() / 3 + 2));
addVertex(0, 1, 0, vertices);
addVertex(0, 1, -1, vertices);
addVertex(1, 1, -1, vertices);
addVertex(1, 1, 0, vertices);
addNormals(0, 1, 0, normals);
addNormals(0, 1, 0, normals);
addNormals(0, 1, 0, normals);
addNormals(0, 1, 0, normals);
addTextureCoords(0, 0, textureCoords);
addTextureCoords(1, 0, textureCoords);
addTextureCoords(1, 1, textureCoords);
addTextureCoords(0, 1, textureCoords);
float[] verticesArray = new float[vertices.size()];
float[] normalsArray = new float[normals.size()];
float[] texturesArray = new float[textureCoords.size()];
short[] indicesArray = new short[indices.size()];
for (int i = 0; i < vertices.size(); i++) {
verticesArray[i] = vertices.get(i);
}
for (int i = 0; i < indices.size(); i++) {
indicesArray[i] = indices.get(i);
}
for (int i = 0; i < normals.size(); i++) {
normalsArray[i] = normals.get(i);
}
for (int i = 0; i < textureCoords.size(); i++) {
texturesArray[i] = textureCoords.get(i);
}
cube = new HawkMesh(false, verticesArray, indicesArray, texturesArray, normalsArray);
}
return cube;
}