private static Mesh reorderLists(List<Vector3f> posList, List<Vector2f> textCoordList, List<Vector3f> normList, List<Face> facesList) { List<Integer> indices = new ArrayList(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; for (Vector3f pos : posList) { posArr[i * 3] = pos.x; posArr[i * 3 + 1] = pos.y; posArr[i * 3 + 2] = pos.z; i++; } float[] textCoordArr = new float[posList.size() * 2]; float[] normArr = new float[posList.size() * 3]; for (Face face : facesList) { IdxGroup[] faceVertexIndices = face.getFaceVertexIndices(); for (IdxGroup indValue : faceVertexIndices) { processFaceVertex(indValue, textCoordList, normList, indices, textCoordArr, normArr); } } int[] indicesArr = new int[indices.size()]; indicesArr = indices.stream().mapToInt((Integer v) -> v).toArray(); Mesh mesh = new Mesh(posArr, textCoordArr, normArr, indicesArr); return mesh; }
return reorderLists(vertices, textures, normals, faces);
public SkyBox(String objModel, String textureFile) throws Exception { super(); Mesh skyBoxMesh = OBJLoader.loadMesh(objModel); Texture skyBoxtexture = new Texture(textureFile); skyBoxMesh.setMaterial(new Material(skyBoxtexture, 0.0f)); setMesh(skyBoxMesh); setPosition(0, 0, 0); } }
public SkyBox(String objModel, String textureFile) throws Exception { super(); Mesh skyBoxMesh = OBJLoader.loadMesh(objModel); Texture skyBoxtexture = new Texture(textureFile); skyBoxMesh.setMaterial(new Material(skyBoxtexture, 0.0f)); setMesh(skyBoxMesh); setPosition(0, 0, 0); } }
public SkyBox(String objModel, String textureFile) throws Exception { super(); Mesh skyBoxMesh = OBJLoader.loadMesh(objModel); Texture skyBoxtexture = new Texture(textureFile); skyBoxMesh.setMaterial(new Material(skyBoxtexture, 0.0f)); setMesh(skyBoxMesh); setPosition(0, 0, 0); } }
private static Mesh reorderLists(List<Vector3f> posList, List<Vector2f> textCoordList, List<Vector3f> normList, List<Face> facesList) { List<Integer> indices = new ArrayList(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; for (Vector3f pos : posList) { posArr[i * 3] = pos.x; posArr[i * 3 + 1] = pos.y; posArr[i * 3 + 2] = pos.z; i++; } float[] textCoordArr = new float[posList.size() * 2]; float[] normArr = new float[posList.size() * 3]; for (Face face : facesList) { IdxGroup[] faceVertexIndices = face.getFaceVertexIndices(); for (IdxGroup indValue : faceVertexIndices) { processFaceVertex(indValue, textCoordList, normList, indices, textCoordArr, normArr); } } int[] indicesArr = new int[indices.size()]; indicesArr = indices.stream().mapToInt((Integer v) -> v).toArray(); Mesh mesh = new Mesh(posArr, textCoordArr, normArr, indicesArr); return mesh; }
return reorderLists(vertices, textures, normals, faces);
public SkyBox(String objModel, String textureFile) throws Exception { super(); Mesh skyBoxMesh = OBJLoader.loadMesh(objModel); Texture skyBoxtexture = new Texture(textureFile); skyBoxMesh.setMaterial(new Material(skyBoxtexture, 0.0f)); setMesh(skyBoxMesh); setPosition(0, 0, 0); } }
private static Mesh reorderLists(List<Vector3f> posList, List<Vector2f> textCoordList, List<Vector3f> normList, List<Face> facesList) { List<Integer> indices = new ArrayList(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; for (Vector3f pos : posList) { posArr[i * 3] = pos.x; posArr[i * 3 + 1] = pos.y; posArr[i * 3 + 2] = pos.z; i++; } float[] textCoordArr = new float[posList.size() * 2]; float[] normArr = new float[posList.size() * 3]; for (Face face : facesList) { IdxGroup[] faceVertexIndices = face.getFaceVertexIndices(); for (IdxGroup indValue : faceVertexIndices) { processFaceVertex(indValue, textCoordList, normList, indices, textCoordArr, normArr); } } int[] indicesArr = new int[indices.size()]; indicesArr = indices.stream().mapToInt((Integer v) -> v).toArray(); Mesh mesh = new Mesh(posArr, textCoordArr, normArr, indicesArr); return mesh; }
return reorderLists(vertices, textures, normals, faces);
public SkyBox(String objModel, String textureFile) throws Exception { super(); Mesh skyBoxMesh = OBJLoader.loadMesh(objModel); Texture skyBoxtexture = new Texture(textureFile); skyBoxMesh.setMaterial(new Material(skyBoxtexture, 0.0f)); setMesh(skyBoxMesh); setPosition(0, 0, 0); } }
private static Mesh reorderLists(List<Vector3f> posList, List<Vector2f> textCoordList, List<Vector3f> normList, List<Face> facesList) { List<Integer> indices = new ArrayList(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; for (Vector3f pos : posList) { posArr[i * 3] = pos.x; posArr[i * 3 + 1] = pos.y; posArr[i * 3 + 2] = pos.z; i++; } float[] textCoordArr = new float[posList.size() * 2]; float[] normArr = new float[posList.size() * 3]; for (Face face : facesList) { IdxGroup[] faceVertexIndices = face.getFaceVertexIndices(); for (IdxGroup indValue : faceVertexIndices) { processFaceVertex(indValue, textCoordList, normList, indices, textCoordArr, normArr); } } int[] indicesArr = new int[indices.size()]; indicesArr = indices.stream().mapToInt((Integer v) -> v).toArray(); Mesh mesh = new Mesh(posArr, textCoordArr, normArr, indicesArr); return mesh; }
return reorderLists(vertices, textures, normals, faces);
public SkyBox(String objModel, String textureFile) throws Exception { super(); Mesh skyBoxMesh = OBJLoader.loadMesh(objModel); Texture skyBoxtexture = new Texture(textureFile); skyBoxMesh.setMaterial(new Material(skyBoxtexture, 0.0f)); setMesh(skyBoxMesh); setPosition(0, 0, 0); } }
private static Mesh reorderLists(List<Vector3f> posList, List<Vector2f> textCoordList, List<Vector3f> normList, List<Face> facesList) { List<Integer> indices = new ArrayList(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; for (Vector3f pos : posList) { posArr[i * 3] = pos.x; posArr[i * 3 + 1] = pos.y; posArr[i * 3 + 2] = pos.z; i++; } float[] textCoordArr = new float[posList.size() * 2]; float[] normArr = new float[posList.size() * 3]; for (Face face : facesList) { IdxGroup[] faceVertexIndices = face.getFaceVertexIndices(); for (IdxGroup indValue : faceVertexIndices) { processFaceVertex(indValue, textCoordList, normList, indices, textCoordArr, normArr); } } int[] indicesArr = new int[indices.size()]; indicesArr = indices.stream().mapToInt((Integer v) -> v).toArray(); Mesh mesh = new Mesh(posArr, textCoordArr, normArr, indicesArr); return mesh; }
return reorderLists(vertices, textures, normals, faces);
public SkyBox(String objModel, String textureFile) throws Exception { super(); Mesh skyBoxMesh = OBJLoader.loadMesh(objModel); Texture skyBoxtexture = new Texture(textureFile); skyBoxMesh.setMaterial(new Material(skyBoxtexture, 0.0f)); setMesh(skyBoxMesh); setPosition(0, 0, 0); } }
private static Mesh reorderLists(List<Vector3f> posList, List<Vector2f> textCoordList, List<Vector3f> normList, List<Face> facesList) { List<Integer> indices = new ArrayList(); // Create position array in the order it has been declared float[] posArr = new float[posList.size() * 3]; int i = 0; for (Vector3f pos : posList) { posArr[i * 3] = pos.x; posArr[i * 3 + 1] = pos.y; posArr[i * 3 + 2] = pos.z; i++; } float[] textCoordArr = new float[posList.size() * 2]; float[] normArr = new float[posList.size() * 3]; for (Face face : facesList) { IdxGroup[] faceVertexIndices = face.getFaceVertexIndices(); for (IdxGroup indValue : faceVertexIndices) { processFaceVertex(indValue, textCoordList, normList, indices, textCoordArr, normArr); } } int[] indicesArr = new int[indices.size()]; indicesArr = indices.stream().mapToInt((Integer v) -> v).toArray(); Mesh mesh = new Mesh(posArr, textCoordArr, normArr, indicesArr); return mesh; }
return reorderLists(vertices, textures, normals, faces);
public SkyBox(String objModel, String textureFile) throws Exception { super(); Mesh skyBoxMesh = OBJLoader.loadMesh(objModel); Texture skyBoxtexture = new Texture(textureFile); skyBoxMesh.setMaterial(new Material(skyBoxtexture, 0.0f)); setMesh(skyBoxMesh); setPosition(0, 0, 0); } }