threejs.miniprogram icon indicating copy to clipboard operation
threejs.miniprogram copied to clipboard

小程序渲染glb模型后无法响应任何事件

Open yukiSolo opened this issue 2 years ago • 0 comments

加载基本的cube没有问题,加载obj模型没有问题;但加载glb后,微信开发者工具可以响应事件,真机上无法响应事件,附加载glb模型的代码:

        let GLTFLoader = gLTF(THREE)
        const gltfLoader = new GLTFLoader();
        gltfLoader.load(glbUrl, (gltf) => {
          const item = gltf.scene;
          _this.modelItem = item;
          _this.scene.add(_this.modelItem);
          _this.lights.forEach(light => {
            light.target = _this.modelItem
          })
          _this.inited = true;
          uni.hideLoading();
          
          _this.render();
        }, (res) => {
          console.log('progress res:', res)
        }, (error) => {
          uni.hideLoading();
          console.log('error:', error)
        });

yukiSolo avatar Dec 29 '22 07:12 yukiSolo