Skip to content

Commit

Permalink
Also invert the y axis of the uv coordinates in write_obj(...)
Browse files Browse the repository at this point in the history
Previously we only inverted them in write_textured_obj(...). I believe this was an oversight, since when using write_obj(...), one would rarely use the uv coords.
  • Loading branch information
patrikhuber committed May 28, 2019
1 parent 099c27c commit 7ce2918
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/eos/core/write_obj.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ inline void write_obj(Mesh mesh, std::string filename)
{
for (auto&& tc : mesh.texcoords)
{
obj_file << "vt " << tc[0] << " " << tc[1] << std::endl;
obj_file << "vt " << tc[0] << " " << 1.0f - tc[1] << std::endl;
// We invert y because MeshLab's uv origin (0, 0) is on the bottom-left
}
}

Expand Down

0 comments on commit 7ce2918

Please sign in to comment.