Hi,

I have been dealing with OBJ files exported from 3DSMax which only had information about 1 object. Now there are multiple objects and as I can see, the OBJ file is divided into sections with Vertices, Texture Coordinates and Faces related to each object. Now the problem is that some of the exported faces for each object refer to vertex indices that do not exist in the list. So for example:

f 50/71 62/88 63/89 
f 50/71 63/89 51/73
f 51/73 63/89 64/90


is a part of the text for exported faces. Now the last line refers to vertices 51, 63 and 64 (1-based index). But the vertices that I have are only:

...
...
v  1.5780 3.0863 0.8184
v  1.3791 3.0863 0.4199
v  0.6928 2.8557 1.0150
# 62 vertices


Any ideas?

I have attached the OBJ file to this post. This happens for the object whose definition starts at line 178 in the OBJ file. Line 367 is one of the lines that to me doesn't seem correct:

f 51/73 63/89 64/90 


It refers to vertex 64 which clearly doesn't exist for the sphere with 62 vertices only. Any ideas why this is happening?
Attachments:
Posted on 2008-12-23 08:23:24 by XCHG
I think I have the answer actually :shock: I think it increments the second object's indices by the number of indices that have been found in the previous object. So if object 1 in the OBJ file has its first face like this:

f 1/1 2/2 3/3


And this object has 40 vertices, the next object's face will have the vertex indices start from 41, right? Yeah I think that's right!
Posted on 2008-12-23 08:30:49 by XCHG