I’m trying to load an Obj file (3d model file) for OGL.
The entire concept behind it is really easy in conjunction with regex.
The problem is how would I make regex include negative numbers?
However take a look at my console output:
1.0, 1.0, 1.0
1.0, 1.0, 1.0
1.0, 1.0, 1.0
1.0, 1.0, 1.0
1.0, 1.0, 1.0
1.0, 1.0, 1.0
1.0, 1.0, 1.0
1.0, 1.0, 1.0
1, 3, 4, 2
5, 7, 8, 6
1, 5, 6, 2
3, 7, 8, 4
1, 5, 7, 3
2, 6, 8, 4
Now take a look at the file:
v 1 1 1
v 1 1 -1
v 1 -1 1
v 1 -1 -1
v -1 1 1
v -1 1 -1
v -1 -1 1
v -1 -1 -1
f 1 3 4 2
f 5 7 8 6
f 1 5 6 2
f 3 7 8 4
f 1 5 7 3
f 2 6 8 4
The negative values don’t appear.
Here is my loader code:
http://members.optusnet.com.au/ksaho/algorithm/ObjLoader.java
It’s obviously unoptimised because I’m focusing on getting it to work before performance.
Also is there any way that I could go from (Float[]) to (float[]) without using loops?