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

Texture coordinates are flipped vertically #13

Closed
javagl opened this issue Jun 27, 2016 · 3 comments
Closed

Texture coordinates are flipped vertically #13

javagl opened this issue Jun 27, 2016 · 3 comments

Comments

@javagl
Copy link

javagl commented Jun 27, 2016

This has already been mentioned in #6 . The recommendation there was to flip the input image vertically. But this seems to be a dubious workaround.

Attached is a file that contains the Duck, as an OBJ. This OBJ is displayed properly in http://www.open3mod.com/ and http://meshlab.sourceforge.net/ . Converting it with OBJ2GLTF results in the second attached file (where I only fixed CesiumGS/gltf-pipeline#114 in the shader manually). In this glTF, the texture coordinates are flipped vertically. (I only checked this with my own glTF viewer, but it properly displays Duck model from the glTF samples, so something must be wrong with the converted one...)

DuckObj.zip
DuckGltf.zip

@lilleyse
Copy link
Contributor

Yup it's not a good workaround, thanks for sending over your models I'll check it out soon.

@lilleyse
Copy link
Contributor

I changed the converter to flip the uv coordinates vertically. I may have had some cases where the obj defined it's uv's as 0.0 as bottom and 1.0 as top, but it seems that most exporters do the opposite. Feel free to test your model, it works for me now.

@javagl
Copy link
Author

javagl commented Jul 1, 2016

Thanks, it now works as expected.

(Actually, I only noticed this because I'm also trying some OBJ-to-GLTF conversion, stumbled over this issue, wanted to compare it to the "reference" OBJ2GLTF implementation ... and saw that it produced the same result. Indeed, there seems to be no strict convention about texture coordinates in OBJ, but the one in the example seems to be more common)

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