From e9cab14ae60491cc9512d8a76792d27e8ec5f792 Mon Sep 17 00:00:00 2001 From: Yakim3396 Date: Tue, 8 Dec 2020 19:57:05 +0300 Subject: [PATCH 1/2] Disable mirroring on axis and flip faces --- src/model/model.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/model/model.cpp b/src/model/model.cpp index b37e8f7..54a9897 100644 --- a/src/model/model.cpp +++ b/src/model/model.cpp @@ -97,7 +97,7 @@ static void load_translated(aim_vector3 &v, const buffer &b) READ(b, v.y); READ(b, v.x); READ(b, v.z); - v.y = -v.y; + //v.y = -v.y; // after load we have eMayaYUp } @@ -140,7 +140,12 @@ void vertex::load(const buffer &b, uint32_t flags) void face::load(const buffer &b) { - READ(b, vertex_list); + uint16_t lvertex_list[3]; + READ(b, lvertex_list); + + vertex_list[2] = lvertex_list[0]; + vertex_list[1] = lvertex_list[1]; + vertex_list[0] = lvertex_list[2]; } static String print_float(double v) From 77a4319ad054a0de39d37d2c49b462dbbb3b6c8b Mon Sep 17 00:00:00 2001 From: Yakim3396 Date: Tue, 8 Dec 2020 20:46:25 +0300 Subject: [PATCH 2/2] Fix face mirroring use std::swap --- src/model/model.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/model/model.cpp b/src/model/model.cpp index 54a9897..1d0f307 100644 --- a/src/model/model.cpp +++ b/src/model/model.cpp @@ -140,12 +140,8 @@ void vertex::load(const buffer &b, uint32_t flags) void face::load(const buffer &b) { - uint16_t lvertex_list[3]; - READ(b, lvertex_list); - - vertex_list[2] = lvertex_list[0]; - vertex_list[1] = lvertex_list[1]; - vertex_list[0] = lvertex_list[2]; + READ(b, vertex_list); + std::swap(vertex_list[0], vertex_list[2]); } static String print_float(double v)