From 2eb5faa1fe73793fdf206105d8f8a7d3b7278113 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 16 Nov 2021 00:37:46 +0000 Subject: Transform obj to ILT was a static mat4 --- gfx/models/obj.impl.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gfx') 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 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; }); } -- cgit v1.2.3