throw new AssertionError("Faces array size is not correct: " + tMesh.getPoints().size()); if (numFaces != tMesh.getFaceSmoothingGroups().size() && tMesh.getFaceSmoothingGroups().size() > 0) { throw new AssertionError("FaceSmoothingGroups array size is not correct: " + tMesh.getPoints().size() + ", numFaces = " + numFaces);
triangleMesh.getTexCoords().addAll(convertToFloatArray(texturePoints)); triangleMesh.getFaces().addAll(indices); triangleMesh.getFaceSmoothingGroups().addAll(new int[indices.length / triangleMesh.getFaceElementSize()]); triangleMesh.getNormals().addAll(convertToFloatArray(normals));
triangleMesh.getTexCoords().addAll(convertToFloatArray(texturePoints)); triangleMesh.getFaces().addAll(indices); triangleMesh.getFaceSmoothingGroups().addAll(new int[indices.length / triangleMesh.getFaceElementSize()]); triangleMesh.getNormals().addAll(convertToFloatArray(normals));
int[] newFaceNormals = ((IntegerArrayList) faceNormals.subList(facesNormalStart, faceNormals.size())).toIntArray(); int[] smGroups = SmoothingGroups.calcSmoothGroups(mesh, newFaces, newFaceNormals, newNormals.toFloatArray()); mesh.getFaceSmoothingGroups().setAll(smGroups); } else { mesh.getFaceSmoothingGroups().setAll(((IntegerArrayList) smoothingGroups.subList(smoothingGroupsStart, smoothingGroups.size())).toIntArray()); + mesh.getTexCoords().size() / mesh.getTexCoordElementSize() + " uvs, " + mesh.getFaces().size() / mesh.getFaceElementSize() + " faces, " + mesh.getFaceSmoothingGroups().size() + " smoothing groups."); log("material diffuse color = " + ((PhongMaterial) material).getDiffuseColor()); log("material diffuse map = " + ((PhongMaterial) material).getDiffuseMap());
triangleMesh.getFaceSmoothingGroups().clear(); triangleMesh.getFaceSmoothingGroups().setAll(smoothingGroupsArray);
TriangleMesh mesh = (TriangleMesh) meshView.getMesh(); ObservableIntegerArray faces = mesh.getFaces(); ObservableIntegerArray faceSmoothingGroups = mesh.getFaceSmoothingGroups(); ObservableFloatArray points = mesh.getPoints(); newFaces.clear();