yeah
This commit is contained in:
1 parent
65d844ca2a
commit
c14411bd7b
1 file changed
+9
-2
@@ -17,8 +17,8 @@ public class Mesh {
|
|||||||
public void loadObj(String file_path) {
|
public void loadObj(String file_path) {
|
||||||
Scanner scanner;
|
Scanner scanner;
|
||||||
File obj;
|
File obj;
|
||||||
ArrayList<Float> vertices;
|
ArrayList<Float> vertices = new ArrayList<>();
|
||||||
ArrayList<Float> normals;
|
ArrayList<Float> normals = new ArrayList<>();
|
||||||
|
|
||||||
String line;
|
String line;
|
||||||
String[] face_data_temp;
|
String[] face_data_temp;
|
||||||
@@ -36,7 +36,14 @@ public class Mesh {
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (scanner.hasNextLine()) {
|
while (scanner.hasNextLine()) {
|
||||||
|
line = scanner.nextLine();
|
||||||
|
|
||||||
|
String[] data = line.split(" ");
|
||||||
|
|
||||||
|
switch (data[0]) {
|
||||||
|
case "v":
|
||||||
|
vertices.add(Float.valueOf(data[1]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user