|
@@ -37,6 +37,7 @@ public class OBJReader {
|
|
|
ArrayList<Face> Faces = new ArrayList<>();
|
|
|
AtomicReference<HashMap<String, Color>> materials = new AtomicReference<>(new HashMap<>());
|
|
|
AtomicReference<Color> color = new AtomicReference<>(new Color(0, 0, 0));
|
|
|
+ List<Vector4f> p = getPoints(OBJFile);
|
|
|
reader.lines().forEach(l -> {
|
|
|
try {
|
|
|
materials.set(MTLReader.getColors(MTLFile));
|
|
@@ -72,13 +73,8 @@ public class OBJReader {
|
|
|
} else {
|
|
|
log.error("A face had more than 4 point, ignoring it");
|
|
|
}
|
|
|
- try {
|
|
|
- List<Vector4f> p = getPoints(OBJFile);
|
|
|
- for (Integer index : face.pointsIndex) {
|
|
|
- face.points.add(p.get(index-1));
|
|
|
- }
|
|
|
- } catch (FileNotFoundException e) {
|
|
|
- throw new RuntimeException(e);
|
|
|
+ for (Integer index : face.pointsIndex) {
|
|
|
+ face.points.add(p.get(index-1));
|
|
|
}
|
|
|
}
|
|
|
});
|