Explorar o código

ColladaLoader2: WIP Z_UP

Mr.doob %!s(int64=9) %!d(string=hai) anos
pai
achega
3c8aa5d44d
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      examples/js/loaders/ColladaLoader2.js

+ 6 - 1
examples/js/loaders/ColladaLoader2.js

@@ -468,7 +468,12 @@ THREE.ColladaLoader.prototype = {
 					function pushVector( i ) {
 
 						var index = indices[ i + offset ] * 3;
-						array.push( source[ index + 0 ], source[ index + 1 ], source[ index + 2 ] );
+
+						if ( asset.upAxis === 'Z_UP' ) {
+							array.push( source[ index + 0 ], source[ index + 2 ], - source[ index + 1 ] );
+						} else {
+							array.push( source[ index + 0 ], source[ index + 1 ], source[ index + 2 ] );
+						}
 
 					}