diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-11-16 00:37:46 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-11-16 00:37:46 +0000 |
commit | 2eb5faa1fe73793fdf206105d8f8a7d3b7278113 (patch) | |
tree | d59799d0ef6fa7429c464ba398ae981e8a416ba2 /gfx/models | |
parent | Swap y,z axis (diff) | |
download | ilt-2eb5faa1fe73793fdf206105d8f8a7d3b7278113.tar.bz2 ilt-2eb5faa1fe73793fdf206105d8f8a7d3b7278113.tar.xz ilt-2eb5faa1fe73793fdf206105d8f8a7d3b7278113.zip |
Transform obj to ILT was a static mat4
Diffstat (limited to 'gfx/models')
-rw-r--r-- | gfx/models/obj.impl.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gfx/models/obj.impl.cpp b/gfx/models/obj.impl.cpp index 0701d13..02996da 100644 --- a/gfx/models/obj.impl.cpp +++ b/gfx/models/obj.impl.cpp @@ -17,8 +17,13 @@ ObjParser::ObjParser(std::unique_ptr<std::istream> in) : yyFlexLexer(in.get()) ObjParser::yylex(); assert(in->good()); std::for_each(vertices.begin(), vertices.end(), [](auto & v) { - std::swap(v.y, v.z); - v.x = -v.x; + constexpr const glm::mat4 obj2ilt { + -1, 0, 0, 0, // x + 0, 0, 1, 0, // y + 0, 1, 0, 0, // z + 0, 0, 0, 0, // w + }; + v = v * obj2ilt; }); } |