0

Being new to .obj and 3D rendering please excuse my ignorance, I will formulate the question as clearly as I can.

My program will accept .obj files formatted like this:

g Cube.006
v 2.016505 -3.960833 -1.000000
v 2.016505 -3.960833 1.000000
v 2.016506 3.960833 -1.000000
v 2.016503 3.960833 1.000000
usemtl Material
s off
f 5 7 6
f 7 8 6
g Cube.005
v 2.016505 -3.960833 -1.000000
v -2.016504 -3.960833 -1.000000
v 2.016506 3.960833 -1.000000
v -2.016505 3.960833 -1.000000
usemtl Material
s off
f 11 9 10
f 11 10 12
g Cube.004
v 2.016505 -3.960833 1.000000
v -2.016505 -3.960833 1.000000
v 2.016503 3.960833 1.000000
v -2.016505 3.960833 0.999999 

...

But not like this:

# Blender v2.79 (sub 0) OBJ File: 'dog.obj'
# www.blender.org
mtllib dog2.mtl
o dog
v 0.026488 -0.079544 0.114278
v 0.025089 -0.079691 0.102180
v 0.017257 -0.081537 0.105084
v 0.035739 -0.074934 0.114427
v 0.014641 -0.079851 0.112253
v 0.037497 -0.070168 0.103995
v 0.015706 -0.077305 0.095986
v 0.008963 -0.078464 0.098096
v 0.041251 -0.067345 0.110544
v -0.000575 -0.074153 0.105018
v 0.042610 -0.043805 0.116670
v 0.002946 -0.073158 0.113258
v 0.032568 -0.058086 0.088628
v 0.002853 -0.072975 0.092809

...

vn -0.8948 -0.4399 0.0756
vn 0.7067 -0.5483 -0.4470
vn -0.6659 -0.7099 0.2295
vn 0.8051 0.5931 0.0064
usemtl None
s off
f 1//1 2//1 3//1
f 2//2 1//2 4//2
f 1//3 3//3 5//3
f 6//4 2//4 4//4
f 3//5 2//5 7//5
f 3//6 7//6 8//6
f 6//7 4//7 9//7
f 5//8 3//8 10//8

...

Could somebody who is familiar with the internal structure of .obj files please direct me toward some documentation or briefly describe what the distinction is please?

Kind regards.

Leo Naylor
  • 13
  • 2
  • http://www.fileformat.info/format/wavefrontobj/egff.htm . In first fragment you don't have normals, and use `g` (group) instead of `o` (object) for grouping, which in many cases means the same thing. – keltar Aug 17 '18 at 05:40
  • Thanks for your comment Keltar. I think it was particularly the distinction between the f notation here: f3//6 7//6 8//6 vs f 1 2 4 [newline] f 1 2 3 for example, that had me perplexed. – Leo Naylor Aug 17 '18 at 12:16
  • f have 3 variants - `f V`, `f V/T` and `f V/T/N`, where V is vertex index, T is texture coordinates index (`vt` line) and N is normal index (`vn`). – keltar Aug 17 '18 at 12:45
  • Thank you that is useful to me! – Leo Naylor Aug 17 '18 at 14:22

1 Answers1

0

As keltar has explained, the difference between the two files shown is the fact that the extra f digits signify texture. The program I am processing .obj files with will not handle the additional texture data. This may be useful to somebody else who is unfamiliar with .obj file contents.

Leo Naylor
  • 13
  • 2