parent
aade867128
commit
0192ab1ebe
@ -0,0 +1,26 @@ |
||||
v 0 0 0 |
||||
v 0 0 1 |
||||
v 0 1 0 |
||||
v 0 1 1 |
||||
v 1 0 0 |
||||
v 1 0 1 |
||||
v 1 1 0 |
||||
v 1 1 1 |
||||
|
||||
vt 0 0 #1 |
||||
vt 0 1 #2 |
||||
vt 1 0 #3 |
||||
vt 1 1 #4 |
||||
|
||||
f 1/2 3/1 7/3 |
||||
f 1/2 7/3 8/4 |
||||
f 5/2 7/1 8/3 |
||||
f 5/2 8/3 6/4 |
||||
f 6/2 8/1 4/3 |
||||
f 6/2 4/3 2/4 |
||||
f 2/2 4/1 3/3 |
||||
f 2/2 3/3 1/4 |
||||
f 3/2 4/1 8/3 |
||||
f 3/2 8/3 7/4 |
||||
f 6/2 2/1 1/3 |
||||
f 6/2 1/3 5/4 |
@ -1,11 +1,24 @@ |
||||
package sig; |
||||
|
||||
import java.io.File; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
import sig.utils.OBJReader; |
||||
|
||||
public class Mesh { |
||||
List<Triangle> triangles = new ArrayList<>(); |
||||
Mesh(List<Triangle> tris) { |
||||
this.triangles=tris; |
||||
} |
||||
Mesh(String obj) { |
||||
this.triangles=OBJReader.ReadOBJFile(obj,false); |
||||
} |
||||
Mesh(String obj,String tex) { |
||||
this.triangles=OBJReader.ReadOBJFile(obj,true); |
||||
Texture te = new Texture(new File(tex)); |
||||
for (Triangle t : triangles) { |
||||
t.tex=te; |
||||
} |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue