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

expose 'normals' in Wavefront object #111

Closed
hananbeer opened this issue Apr 22, 2020 · 4 comments
Closed

expose 'normals' in Wavefront object #111

hananbeer opened this issue Apr 22, 2020 · 4 comments

Comments

@hananbeer
Copy link

hananbeer commented Apr 22, 2020

I couldn't find how to access 'normals' in the doc. looking at the code it seems they are parsed but not exposed;

eventually I managed to access it by 'obj.parser.normals' but it isn't trivial.
also I'm not sure about the format, shouldn't they be per mesh/material, and not global?

edit:
I'm not too familiar with the format, but this seems incorrect:
obj.meshes[None].materials[0].vertices

gives an UNORDERED list of normals, not vertices, definitely not obj.vertices (which produces correct results)

@einarf
Copy link
Member

einarf commented Apr 22, 2020

It needs to be documented, but searching in the issues here you can find : #87 (comment)

@hananbeer
Copy link
Author

hananbeer commented Apr 22, 2020

I continued playing with this object a bit more and I observed the following:
(edited original comment)

I'm not too familiar with the format, but this seems incorrect:
obj.meshes[None].materials[0].vertices

gives an UNORDERED list of normals, not vertices, definitely not obj.vertices (which produces correct results)

edit:
ah, I see in the issue you posted, material[].vertices provides ALL information, including UV, normals, etc... kinda unclear imo.
thanks.

ok got it :)

@einarf
Copy link
Member

einarf commented Apr 22, 2020

Yep. You just have to look at the format string. The attributes are always in the same order, so its simple to check what attributes are present with a couple of "N3F" in format.

@einarf
Copy link
Member

einarf commented Apr 23, 2020

Closing and duping this with #103

@einarf einarf closed this as completed Apr 23, 2020
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