From: johnmaf Date: Wed, 14 Sep 2016 22:03:52 +0000 (-0400) Subject: Flip UVs in glTFExporter X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8b3f348d6308591044d9b61ae77f5b99057c08ec;p=platform%2Fupstream%2Fassimp.git Flip UVs in glTFExporter --- diff --git a/code/glTFExporter.cpp b/code/glTFExporter.cpp index e333272..b610e00 100644 --- a/code/glTFExporter.cpp +++ b/code/glTFExporter.cpp @@ -291,6 +291,13 @@ void glTFExporter::ExportMeshes() if (n) p.attributes.normal.push_back(n); for (int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i) { + // Flip UV y coords + if (aim -> mNumUVComponents[i] > 1) { + for (unsigned int j = 0; j < aim->mNumVertices; ++j) { + aim->mTextureCoords[i][j].y = 1 - aim->mTextureCoords[i][j].y; + } + } + if (aim->mNumUVComponents[i] > 0) { AttribType::Value type = (aim->mNumUVComponents[i] == 2) ? AttribType::VEC2 : AttribType::VEC3; Ref tc = ExportData(*mAsset, meshId, b, aim->mNumVertices, aim->mTextureCoords[i], AttribType::VEC3, type, ComponentType_FLOAT, true);