From 4116ec7a6a39d4c9a0b3bcea4d77fe9b281a14e1 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Sat, 7 May 2011 13:14:56 +0000 Subject: [PATCH] # fix global orientation for IFC models git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@983 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/IFCLoader.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/IFCLoader.cpp b/code/IFCLoader.cpp index c3e14d68f..47569a035 100644 --- a/code/IFCLoader.cpp +++ b/code/IFCLoader.cpp @@ -287,10 +287,12 @@ void IFCImporter::InternReadFile( const std::string& pFile, conv.materials.clear(); } - // apply world coordinate system (which includes the scaling to convert to metres) - aiMatrix4x4 scale; + // apply world coordinate system (which includes the scaling to convert to metres and a -90 degrees rotation around x) + aiMatrix4x4 scale, rot; aiMatrix4x4::Scaling(aiVector3D(conv.len_scale,conv.len_scale,conv.len_scale),scale); - pScene->mRootNode->mTransformation = scale * conv.wcs * pScene->mRootNode->mTransformation; + aiMatrix4x4::RotationX(-AI_MATH_HALF_PI_F,rot); + + pScene->mRootNode->mTransformation = rot * scale * conv.wcs * pScene->mRootNode->mTransformation; // this must be last because objects are evaluated lazily as we process them if ( !DefaultLogger::isNullLogger() ){