started custom mesh class
This commit is contained in:
1 parent
82a654f9fa
commit
65d844ca2a
3 files changed
+52
No files matched your search
@@ -0,0 +1,43 @@
|
||||
package org.example;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Scanner;
|
||||
|
||||
public class Mesh {
|
||||
private final int vaoId;
|
||||
private final int vboId;
|
||||
|
||||
public Mesh() {
|
||||
this.vaoId = 0;
|
||||
this.vboId = 0;
|
||||
}
|
||||
|
||||
public void loadObj(String file_path) {
|
||||
Scanner scanner;
|
||||
File obj;
|
||||
ArrayList<Float> vertices;
|
||||
ArrayList<Float> normals;
|
||||
|
||||
String line;
|
||||
String[] face_data_temp;
|
||||
int[] face_data = new int[3];
|
||||
int i;
|
||||
|
||||
// Try to open the file
|
||||
try {
|
||||
obj = new File(file_path);
|
||||
scanner = new Scanner(obj);
|
||||
} catch (FileNotFoundException e) {
|
||||
System.out.println("ERROR: OBJ File \"" + file_path + "\" not found.");
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
while (scanner.hasNextLine()) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user