-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OBJ loader clones all vertices for every material #123
Comments
I'm having a read through the OBJ specification, because some of my files weren't loading and I wasn't sure why. I think there's some more problems with the OBJ loader than I initially thought here. For instance, the
In the Mittsu loader code though, an @danini-the-panini are there any reasons for the loader doing some of this? It's entirely possible I've misunderstood something. If not, and I'm looking at it right, I'm happy to address the |
yeah, i think it was to name the object that the |
Right, that makes sense. I was looking at the THREE.js loader, and it handles it by naming the original object in the case where the first o is encountered later on. I'll have a look. |
OK, I've fixed the |
Not fixing the main face group issue in #126 - needs a bigger bit of work and the PR is good to go to resolve the object problem. Sorry for derailing this issue with another one that turned out not to be related. |
When loading a multi-material OBJ file, such as
male02.obj
, each time a new material is encountered, the existing mesh is finished, a copy made of the vertices, and then a new mesh started. This means that connectivity information becomes more vague, as an loaded object may have multiple meshes, each with separate (albeit coincident) vertices, and a separate list of faces.This is probably fine for rendering, so it may be a low priority issue, but in my use case where I'm trying to convert files, it means that I've lost some information, and when I output a mesh there are lots and lots of unused vertices.
I suspect the right way to solve it is for the loader to use geometry groups, as described in https://threejs.org/docs/index.html?q=buffergeom#api/en/core/BufferGeometry.groups, rather than separate meshes, but I don't know what the state of those is in Mittsu currently.
The text was updated successfully, but these errors were encountered: