44 lines
944 B
Java
44 lines
944 B
Java
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()) {
|
|
|
|
}
|
|
|
|
}
|
|
}
|