Bläddra i källkod

# fix global orientation for IFC models

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@983 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
aramis_acg 14 år sedan
förälder
incheckning
4116ec7a6a
1 ändrade filer med 5 tillägg och 3 borttagningar
  1. 5 3
      code/IFCLoader.cpp

+ 5 - 3
code/IFCLoader.cpp

@@ -287,10 +287,12 @@ void IFCImporter::InternReadFile( const std::string& pFile,
 		conv.materials.clear();
 		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);
 	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
 	// this must be last because objects are evaluated lazily as we process them
 	if ( !DefaultLogger::isNullLogger() ){
 	if ( !DefaultLogger::isNullLogger() ){