I have problem with load threejs model by objectloader, i add newest ThreeJs library version to get more feature like create text, using objectloader... Here is my code:
loadThreeJs() {
const loader = new THREEE.ObjectLoader();
loader.load('./assets/MVP-TW-CCTV TOWER.json', (obj) => {
console.log(obj)
var object3DInside = obj.children[0].children[0];
console.log(object3DInside)
setTimeout(() => {this.addScene(object3DInside)},1000)
}, (xhr) => {
console.log((xhr.loaded / xhr.total * 100) + '% loaded');
});
}
addScene(obj:any)
{
this.viewer.impl.createOverlayScene('load-scene');
this.viewer.impl.addOverlay('load-scene', obj );
this.viewer.impl.invalidate(true);
}
which THREEE is threejs library i loaded from outside. obj
is scene so i get children for object3D but it always return object not an instance of THREE.Object3D.
i log the result and type is object3D, it supposed to be correct but it not?