OBJLoader and lines

I want to use the OBJLoader to load a file with some lines. The loader skips every other line, because it treats the lines as LineSegment, and not as Line. ex. gl.Lines and not gl.LINE_STRIP. I am pretty sure that the format is meant to be read as a poly-line, and not as pairs of lines. (correct me if Iā€™m wrong)

The question is, how could I work around this? Or alternatively, fix it?

lines.obj (168 Bytes)

you can change OBJLoader to create Line? and maybe send them pull request )

I think I was wrong about the OBJ format. There is little to no information in the internet. However in MeshLab, it behaves as in three.js.

Unfortunately, the OBJ format does not clearly specify how lines should be interpreted. As you can see at the following PR, the usage of LineSegment was introduces on purpose:

If we now revert this change, other users will complain who rely on the current implementation. So it seems you have to copy the loader and modify it according to your needs.

1 Like