From b506d35999edcec448b71fa3545f937b9f04dcc2 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 3 Dec 2018 21:53:54 +0100 Subject: [PATCH 1/3] closes https://github.com/assimp/assimp/issues/2247: change include folder from debian package from /usr/lib/include to /usr/include --- assimp.pc.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assimp.pc.in b/assimp.pc.in index 02cf59dc4..c659e19f2 100644 --- a/assimp.pc.in +++ b/assimp.pc.in @@ -1,7 +1,7 @@ prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=@CMAKE_INSTALL_PREFIX@/ libdir=@CMAKE_INSTALL_PREFIX@/@ASSIMP_LIB_INSTALL_DIR@ -includedir=@CMAKE_INSTALL_PREFIX@/@ASSIMP_INCLUDE_INSTALL_DIR@ +includedir=@CMAKE_INSTALL_PREFIX@/../include/@ASSIMP_INCLUDE_INSTALL_DIR@ Name: @CMAKE_PROJECT_NAME@ Description: Import various well-known 3D model formats in an uniform manner. From 8b6c6613f9b1408f43f2e411789401966941624d Mon Sep 17 00:00:00 2001 From: twhittock Date: Tue, 4 Dec 2018 14:44:49 +0000 Subject: [PATCH 2/3] collada export: Use Camera local coordinate system Fixes #2255 --- code/ColladaExporter.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/code/ColladaExporter.cpp b/code/ColladaExporter.cpp index 96421a532..0d5bdd46d 100644 --- a/code/ColladaExporter.cpp +++ b/code/ColladaExporter.cpp @@ -1533,7 +1533,23 @@ void ColladaExporter::WriteNode( const aiScene* pScene, aiNode* pNode) // write transformation - we can directly put the matrix there // TODO: (thom) decompose into scale - rot - quad to allow addressing it by animations afterwards - const aiMatrix4x4& mat = pNode->mTransformation; + aiMatrix4x4 mat = pNode->mTransformation; + + // If this node is a Camera node, the camera coordinate system needs to be multiplied in. + // When importing from Collada, the mLookAt is set to 0, 0, -1, and the node transform is unchanged. + // When importing from a different format, mLookAt is set to 0, 0, 1. Therefore, the local camera + // coordinate system must be changed to matche the Collada specification. + for (size_t i = 0; imNumCameras; i++){ + if (mScene->mCameras[i]->mName == pNode->mName){ + aiMatrix4x4 sourceView; + mScene->mCameras[i]->GetCameraMatrix(sourceView); + + aiMatrix4x4 colladaView; + colladaView.a1 = colladaView.c3 = -1; // move into -z space. + mat *= (sourceView * colladaView); + break; + } + } // customized, sid should be 'matrix' to match with loader code. //mOutput << startstr << ""; From f63caf894e8cd5eee6dbfe0fd4c25895ec5ffdcd Mon Sep 17 00:00:00 2001 From: Paul Arden Date: Thu, 6 Dec 2018 12:56:02 +1100 Subject: [PATCH 3/3] Add check for NULL texcoord values. --- code/glTF2Importer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/glTF2Importer.cpp b/code/glTF2Importer.cpp index 740935601..34f8cfcee 100755 --- a/code/glTF2Importer.cpp +++ b/code/glTF2Importer.cpp @@ -437,6 +437,12 @@ void glTF2Importer::ImportMeshes(glTF2::Asset& r) } for (size_t tc = 0; tc < attr.texcoord.size() && tc < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++tc) { + if (!attr.texcoord[tc]) { + DefaultLogger::get()->warn("NULL texcoord encountered in mesh \"" + mesh.name + + "\" and will be ignored"); + continue; + } + if (attr.texcoord[tc]->count != aim->mNumVertices) { DefaultLogger::get()->warn("Texcoord stream size in mesh \"" + mesh.name + "\" does not match the vertex count");