I have an obj file which looks like this:
mtllib file1.mtl
#
# object f_00
#
v x y z
...
vn x y z
...
vt x y
...
g g_00
usemtl mat1
s 1
f 1/1/1 2/2/2 3/3/3
...
s 2
f 96/51/96 97/52/97 98/53/98 99/54/99
...
s 1
f 104/55/104 105/56/105 106/57/106 107/58/107
...
I know how to read a data when "f " record contains more than 3 group of indices. For processing a data I use following algorithm:
- If that set of indices has not been seen before:
** Add the vertex attributes referenced by that index to the attribute arrays.
** Add the index of the new vertex to the index buffer.
** Store the fact that this particular set of indices has been seen before, and which index you used in the index buffer with it. - If that set of indices has been seen before:
** Retrieve the index for the index buffer that was stored for this set of indices.
** Add that index to the index buffer.
** Do not add any vertex attributes to the attribute arrays
The above obj file contains vn records and the algorithm process them properly so how should I interpret smoothing groups ? Are they necessary in that case ?