From 232acedce7d796efe1d30f9e183a10508df34ce1 Mon Sep 17 00:00:00 2001 From: Anakin Date: Tue, 22 Nov 2016 20:05:02 +0100 Subject: [PATCH] trying to fix the polygon mess up, added new multipoly for testing --- MshViewer/Source/OpenGlController.cpp | 5 ++++- Release/Msh/4-Poly.msh | Bin 0 -> 576 bytes Release/Msh/5-Poly.msh | Bin 0 -> 592 bytes Release/Msh/6-poly.msh | Bin 0 -> 616 bytes 4 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 Release/Msh/4-Poly.msh create mode 100644 Release/Msh/5-Poly.msh create mode 100644 Release/Msh/6-poly.msh diff --git a/MshViewer/Source/OpenGlController.cpp b/MshViewer/Source/OpenGlController.cpp index 9f70075..17fec58 100644 --- a/MshViewer/Source/OpenGlController.cpp +++ b/MshViewer/Source/OpenGlController.cpp @@ -6,6 +6,7 @@ #include #include +#include #define VERTEX_SHADER "Shader/TextureShader.vert" #define FRAGMENT_SHADER "Shader/TextureShader.frag" @@ -388,11 +389,13 @@ void OpenGLController::loadMsh(const char * path) { for (auto& mshIt : segIt->meshIndices) // for every polygon { + std::cout << "== Poly ==" << std::endl; if (mshIt->size() >= 3) // multipoly { // for every triangle of the multi polygon for (unsigned int tri = 0; tri < mshIt->size() - 2; tri++) { + std::cout << "== Triangle ==" << std::endl; // for every edge of the triangle for (int triEdge = 0; triEdge < 3; triEdge++) { @@ -400,7 +403,7 @@ void OpenGLController::loadMsh(const char * path) // every edge has 3 coordinates for (int j = 0; j < 3; j++) tempVertex.position[j] = (GLfloat)segIt->vertex[(*mshIt)[triEdge > 0 ? tri + triEdge : 0] * 3 + j]; - + std::cout << (triEdge > 0 ? tri + triEdge : 0) << std::endl; // and 2 UV if (segIt->uv == NULL) { diff --git a/Release/Msh/4-Poly.msh b/Release/Msh/4-Poly.msh new file mode 100644 index 0000000000000000000000000000000000000000..18119ec3435c50315f47e0b7a961427b62f604ca GIT binary patch literal 576 zcmbVJu};G<5WSWT3=9l>L*0u@98snDu)fGwXv`447(f)7FB z2e`8_O(iBGo!{NPyLo5kIPic(?4 z5#^&Oii54^g}H6~x>}tC^L&vAtCIos@`qKbPDv2$dCfUCEYmR~--GqH3Fouv^Zny3 zWGXkI*J@D?iQCk5iJxQhy}7LLgP8y9#>gCBsF(IK3i@?r6z{;t?YqARONaOW`ouY( iYn)$d?DTpzaO>K?^Tz6$|F_d^d+iqV;Y=MUuKosx8CjhG literal 0 HcmV?d00001 diff --git a/Release/Msh/5-Poly.msh b/Release/Msh/5-Poly.msh new file mode 100644 index 0000000000000000000000000000000000000000..d2e83a3a5570e4d549a08a490cfc55859f901c71 GIT binary patch literal 592 zcmbVIJ5Izf5H)C#C=jCH5EL{J3Mzs_oMa_W64@>m8dyOjkQR2eYyn-av7CSlP;(g$ zfW!rOlf)uRg|IY!GjBf6o=n9iTNi?Cc6bc5!#ueWLgbRvF3?_A57p&`a_VU|oi8fR zB}UQ~a1F+>5T7!NiqU@K_pdtaM?!Gia$keDkfhTS6!0AQ@fDDDcYv)fjThDYZj7Q> zI(Y;>2!hbt&pbc34qukb6K`!ki=;Er0KI&uh;<1;a_1#;Y?Q|%Mt%qDZvto2$@Bf= ztw?lgeXlbz-$QOyw;{S~^}neq=mVMm?8d5;UeSxa4849?SbYj^1J)j|=aJcF7w=sj eSoi#v%?0r?Pc*J0AvEyIk9~xU&`S?IrTQ5EtVzcVk7XB z_<+DMz_*B^ynk8yyT>YQqfNscSG6|y{0dPxJ*5P{L%tjlbKf)KrZ0|{<>F~fMN&9% zLwXPdp$7oJ*Tu(ree2QW(nvTH9noDj%%z@CLv;5AYYfa}pPA?2{wKuq+4TMSbpo+Y ztiS7w$Sx???O6-$!L$5YqH_G9aNphVj;u{H;v1tpK js>WZD#$fYI-)r#Co8A0w?SFmiOu_$<=e*NbJThznGG<+W literal 0 HcmV?d00001