Skip to content
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

Wavefront loader can't correctly locate mtl #40

Open
erisdev opened this issue Apr 18, 2011 · 2 comments
Open

Wavefront loader can't correctly locate mtl #40

erisdev opened this issue Apr 18, 2011 · 2 comments
Assignees

Comments

@erisdev
Copy link

erisdev commented Apr 18, 2011

I'm trying to load a wavefront model, model/steve.obj that references an mtl file in the same directory. When I try to load the model with steve.setSrc('model/steve.obj', location.href), I get this strange error that seems to point to a problem in the path munging.

Error loading Document: model//undefined/steve.mtl status 404

The obj file references it as simply steve.mtl, and I've traced the origin of the extra /undefined/ to GLGE.Wavefront.prototype.getAbsolutePath—I'm just not sure what to make of it. It might be worth the effort to refactor it to use a preexisting path parsing library that knows how to handle some of the edge cases that can come up.

@erisdev
Copy link
Author

erisdev commented Apr 18, 2011

As a recommendation, js-uri seems to handle URIs pretty competently.

@supereggbert
Copy link
Owner

Thought I'd fixed the problem, I'll take another look. I've rewritten the function I'll do some testing to see if it works. If not I'll take a look at closer look at js-uri, it just seems a little bit overkill adding external dependency for path lookups.

@ghost ghost assigned supereggbert Apr 19, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants