|
@@ -1,5 +1,5 @@
|
|
|
import { I3DMLoaderBase } from '../base/I3DMLoaderBase.js';
|
|
|
-import { DefaultLoadingManager, Matrix4, InstancedMesh, Vector3, Quaternion,Euler } from 'three';
|
|
|
+import { DefaultLoadingManager, Matrix4, InstancedMesh, Vector3, Quaternion } from 'three';
|
|
|
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
|
|
|
|
|
|
const tempFwd = new Vector3();
|
|
@@ -15,7 +15,7 @@ export class I3DMLoader extends I3DMLoaderBase {
|
|
|
|
|
|
super();
|
|
|
this.manager = manager;
|
|
|
-
|
|
|
+ this.adjustmentTransform = new Matrix4();
|
|
|
}
|
|
|
|
|
|
resolveExternalURL( url ) {
|
|
@@ -64,6 +64,8 @@ export class I3DMLoader extends I3DMLoaderBase {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ let adjustmentTransform = this.adjustmentTransform;
|
|
|
+
|
|
|
loader.parse( gltfBuffer, workingPath, model => {
|
|
|
|
|
|
const INSTANCES_LENGTH = featureTable.getData( 'INSTANCES_LENGTH' );
|
|
@@ -202,13 +204,14 @@ export class I3DMLoader extends I3DMLoaderBase {
|
|
|
}
|
|
|
|
|
|
|
|
|
- const m = new Matrix4();
|
|
|
- m.set(1.0, 0.0, 0.0, 0.0,
|
|
|
- 0.0, 0.0, -1.0, 0.0,
|
|
|
- 0.0, 1.0, 0.0, 0.0,
|
|
|
- 0.0, 0.0, 0.0, 1.0);
|
|
|
- tempMat.compose( tempPos, tempQuat, tempSca ).multiply(m);
|
|
|
+ // const m = new Matrix4();
|
|
|
+ // m.set(1.0, 0.0, 0.0, 0.0,
|
|
|
+ // 0.0, 0.0, -1.0, 0.0,
|
|
|
+ // 0.0, 1.0, 0.0, 0.0,
|
|
|
+ // 0.0, 0.0, 0.0, 1.0);
|
|
|
+ // tempMat.compose( tempPos, tempQuat, tempSca ).multiply(m);
|
|
|
// tempMat.compose( tempPos, tempQuat, tempSca );
|
|
|
+ tempMat.compose( tempPos, tempQuat, tempSca ).multiply(adjustmentTransform);
|
|
|
|
|
|
for ( let j = 0, l = instances.length; j < l; j ++ ) {
|
|
|
|
|
@@ -219,7 +222,6 @@ export class I3DMLoader extends I3DMLoaderBase {
|
|
|
|
|
|
}
|
|
|
|
|
|
- model.scene.rotation.copy(new Euler(model.scene.rotation.x - Math.PI/2,model.scene.rotation.y,model.scene.rotation.z,'XYZ'))
|
|
|
|
|
|
model.batchTable = batchTable;
|
|
|
model.featureTable = featureTable;
|