可视化/数字孪生专业社区
资源中心
问答
文章
实用工具
ByteVCharts
开源中台
申请建模
申请帮助
登录
注册
申请协助
此单为
付费
协助
×
为协助帮威客用户快速入门,帮威客平台可损供用户特定项目的框架代码开发服务。该服务可为用户快速构建符合项目基本需求的3D可视化框架代码资源(包括源码、3D模型、贴图、数据等),用户的技术团队可在此基础上快速上手,大幅提高3D可视化项目成功基础。
预算金额
公司名称
联系人
微信号
手机号码
提交申请
申请协助
此单为
付费
协助
×
为协助帮威客用户快速入门,帮威客平台可损供用户特定项目的框架代码开发服务。该服务可为用户快速构建符合项目基本需求的3D可视化框架代码资源(包括源码、3D模型、贴图、数据等),用户的技术团队可在此基础上快速上手,大幅提高3D可视化项目成功基础。
预算金额
公司名称
联系人
微信号
手机号码
提交申请
业务咨询
开发咨询
微信咨询
杜老师
黄老师
熊老师
支付信息
×
购买文章
ThreeJS高频使用技术点
订单金额
¥
0
实付金额
¥
0
我已阅读并同意ByteV组件购买协议
取消
提交订单
支付宝支付
微信支付
提交订单
0
点赞
0
评论
收藏
分享
举报
ThreeJS高频使用技术点
Terry
关注
已关注
0
0
0
1641
发表于 2020-08-11 18:55:57
* 场景 scene 基本操作 scene 是所有物体 object 的父级元素 ,可对 object 进行增删查
```e-jsx // 添加物体 scene.add(obj) // obj 默认放在坐标原点,可通过 obj.position.set() 来设置位置 // 移除物体 scene.remove(obj) // 根据 id 或 name 查询 obj scene.getObjectByName(name); scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } scene.add(obj) // obj 默认放在坐标原点,可通过 obj.position.set() 来设置位置 // 移除物体 scene.remove(obj) // 根据 id 或 name 查询 obj scene.getObjectByName(name); scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } .add(obj) // obj 默认放在坐标原点,可通过 obj.position.set() 来设置位置 // 移除物体 scene.remove(obj) // 根据 id 或 name 查询 obj scene.getObjectByName(name); scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } add(obj) // obj 默认放在坐标原点,可通过 obj.position.set() 来设置位置 // 移除物体 scene.remove(obj) // 根据 id 或 name 查询 obj scene.getObjectByName(name); scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } (obj) // obj 默认放在坐标原点,可通过 obj.position.set() 来设置位置 // 移除物体 scene.remove(obj) // 根据 id 或 name 查询 obj scene.getObjectByName(name); scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } obj) // obj 默认放在坐标原点,可通过 obj.position.set() 来设置位置 // 移除物体 scene.remove(obj) // 根据 id 或 name 查询 obj scene.getObjectByName(name); scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } ) // obj 默认放在坐标原点,可通过 obj.position.set() 来设置位置 // 移除物体 scene.remove(obj) // 根据 id 或 name 查询 obj scene.getObjectByName(name); scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } // obj 默认放在坐标原点,可通过 obj.position.set() 来设置位置 // 移除物体 scene.remove(obj) // 根据 id 或 name 查询 obj scene.getObjectByName(name); scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } // obj 默认放在坐标原点,可通过 obj.position.set() 来设置位置 // 移除物体 scene.remove(obj) // 根据 id 或 name 查询 obj scene.getObjectByName(name); scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } // 移除物体 scene.remove(obj) // 根据 id 或 name 查询 obj scene.getObjectByName(name); scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } // 移除物体 scene.remove(obj) // 根据 id 或 name 查询 obj scene.getObjectByName(name); scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } scene.remove(obj) // 根据 id 或 name 查询 obj scene.getObjectByName(name); scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } .remove(obj) // 根据 id 或 name 查询 obj scene.getObjectByName(name); scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } remove(obj) // 根据 id 或 name 查询 obj scene.getObjectByName(name); scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } (obj) // 根据 id 或 name 查询 obj scene.getObjectByName(name); scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } obj) // 根据 id 或 name 查询 obj scene.getObjectByName(name); scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } ) // 根据 id 或 name 查询 obj scene.getObjectByName(name); scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } // 根据 id 或 name 查询 obj scene.getObjectByName(name); scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } // 根据 id 或 name 查询 obj scene.getObjectByName(name); scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } scene.getObjectByName(name); scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } .getObjectByName(name); scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } getObjectByName(name); scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } (name); scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } name); scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } ); scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } ; scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } scene.getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } .getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } getObjectById(id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } (id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } id); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } ); // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } ; // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } // 遍历子元素 scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } scene.traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } .traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } traverse(obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } (obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } obj=>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } =>console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } console.log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } .log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } log(obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } (obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } obj)) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } )) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } ) // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } // 设置背景 initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } initBackground() { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } () { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } ) { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } { var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } var cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } cubeTextureLoader = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } = new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } new THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } THREE.CubeTextureLoader() cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } () cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } ) cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } cubeTextureLoader.setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } .setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } setPath('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } ('textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } 'textures/cube/skybox/') var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } ) var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } var cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } cubeTexture = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } = cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } cubeTextureLoader.load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } .load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } load(['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } (['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } ['px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } 'px.jpg', 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } , 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } 'nx.jpg', 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } , 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } 'py.jpg', 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } , 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } 'ny.jpg', 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } , 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } 'pz.jpg', 'nz.jpg']) this.scene.background = cubeTexture } , 'nz.jpg']) this.scene.background = cubeTexture } 'nz.jpg']) this.scene.background = cubeTexture } 'nz.jpg']) this.scene.background = cubeTexture } ]) this.scene.background = cubeTexture } ) this.scene.background = cubeTexture } this.scene.background = cubeTexture } this.scene.background = cubeTexture } .scene.background = cubeTexture } scene.background = cubeTexture } .background = cubeTexture } background = cubeTexture } = cubeTexture } cubeTexture } } ``` * 物体 Mesh 基本操作
```e-tsx // 加载拥有 mtl 材质的 obj 物体 loadObj(config) { const { path } = config var objLoader = new OBJLoader() //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } loadObj(config) { const { path } = config var objLoader = new OBJLoader() //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } loadObj(config) { const { path } = config var objLoader = new OBJLoader() //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } (config) { const { path } = config var objLoader = new OBJLoader() //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } config) { const { path } = config var objLoader = new OBJLoader() //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ) { const { path } = config var objLoader = new OBJLoader() //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } { const { path } = config var objLoader = new OBJLoader() //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } { const { path } = config var objLoader = new OBJLoader() //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } const { path } = config var objLoader = new OBJLoader() //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } const { path } = config var objLoader = new OBJLoader() //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } { path } = config var objLoader = new OBJLoader() //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } { path } = config var objLoader = new OBJLoader() //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } path } = config var objLoader = new OBJLoader() //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } } = config var objLoader = new OBJLoader() //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } = config var objLoader = new OBJLoader() //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } = config var objLoader = new OBJLoader() //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } config var objLoader = new OBJLoader() //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } var objLoader = new OBJLoader() //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } objLoader = new OBJLoader() //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } = new OBJLoader() //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } new OBJLoader() //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } new OBJLoader() //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } OBJLoader() //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } OBJLoader() //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } () //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ) //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } //obj加载器 var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } var mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } mtlLoader = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } = new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } new MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } MTLLoader() //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } () //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ) //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } //材质文件加载器 mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } mtlLoader.setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } .setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } setTexturePath(path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } (path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } path.substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } .substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } substring(0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } (0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } 0, path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } , path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } path.lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } .lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } lastIndexOf('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ('/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } '/') + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ) + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } + 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } 1)) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } )) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ) return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } return new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } new Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } Promise(res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } (res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } res => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } => { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } { mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } mtlLoader.load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } .load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } load(`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } (`${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } `${path}.mtl`, materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } , materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } materials => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } => { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } { objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } objLoader.setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } .setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } setMaterials(materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } (materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } materials) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ) objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } objLoader.load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } .load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } load( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ( `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } `${path}.obj`, obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } , obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } obj => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } => { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } { this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } this.scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } .scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } scene.add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } .add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } add(obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } (obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } obj) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ) res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } res(obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } (obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } obj) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ) }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } }, xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } , xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } xhr => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } => { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } { if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } if (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } (xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } xhr.lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } .lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } lengthComputable) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ) { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } { var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } var percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } percentComplete = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } = (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } (xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } xhr.loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } .loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } loaded / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } / xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } xhr.total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } .total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } total) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ) * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } * 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } 100 this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } this.container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } .container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } container.querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } .querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } querySelector('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ('#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } '#loading').innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ).innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } .innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } innerHTML = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } = `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } `Loading ${percentComplete.toFixed(1)}` } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ) }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } }) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ) }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } // 设置位置 obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } obj.position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } .position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } position.set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } .set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } set(x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } (x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } x,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ,y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } y,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ,z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } z) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ) obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } obj.position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } .position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } position.x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } .x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } x = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } = x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } x // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } // 设置缩放 obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } obj.scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } .scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } scale.set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } .set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } set(x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } (x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } x,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ,y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } y,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ,z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } z) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ) obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } obj.scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } .scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } scale.x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } .x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } x = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } = x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } x // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } // 设置旋转,初始加载垂直于z轴 obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } obj.rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } .rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } rotation.set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } .set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } set(弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } (弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } 弧度,弧度,弧度) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ) // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } // 设置物体每个部位都可以投影和接收投影 setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } setCastShadowAndReceiveShadow(obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } (obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } obj) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ) { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } { obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } obj.traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } .traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } traverse(function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } (function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } function(child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } (child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } child) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } ) { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } { if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } if (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } (child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } child.isMesh) { child.castShadow = true child.receiveShadow = true } }) } .isMesh) { child.castShadow = true child.receiveShadow = true } }) } isMesh) { child.castShadow = true child.receiveShadow = true } }) } ) { child.castShadow = true child.receiveShadow = true } }) } { child.castShadow = true child.receiveShadow = true } }) } { child.castShadow = true child.receiveShadow = true } }) } child.castShadow = true child.receiveShadow = true } }) } .castShadow = true child.receiveShadow = true } }) } castShadow = true child.receiveShadow = true } }) } = true child.receiveShadow = true } }) } true child.receiveShadow = true } }) } true child.receiveShadow = true } }) } child.receiveShadow = true } }) } .receiveShadow = true } }) } receiveShadow = true } }) } = true } }) } true } }) } true } }) } } }) } } }) } }) } }) } ) } } } ``` * 3d 坐标与 2d 坐标相互转换
```e-kotlin // 3d => 2d getLocalPosition(point) { //获取到窗口的一半高度和一半宽度 const halfWidth = window.innerWidth / 2 const halfHeight = window.innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } getLocalPosition(point) { //获取到窗口的一半高度和一半宽度 const halfWidth = window.innerWidth / 2 const halfHeight = window.innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } getLocalPosition(point) { //获取到窗口的一半高度和一半宽度 const halfWidth = window.innerWidth / 2 const halfHeight = window.innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } (point) { //获取到窗口的一半高度和一半宽度 const halfWidth = window.innerWidth / 2 const halfHeight = window.innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } point) { //获取到窗口的一半高度和一半宽度 const halfWidth = window.innerWidth / 2 const halfHeight = window.innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } ) { //获取到窗口的一半高度和一半宽度 const halfWidth = window.innerWidth / 2 const halfHeight = window.innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } { //获取到窗口的一半高度和一半宽度 const halfWidth = window.innerWidth / 2 const halfHeight = window.innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } { //获取到窗口的一半高度和一半宽度 const halfWidth = window.innerWidth / 2 const halfHeight = window.innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } //获取到窗口的一半高度和一半宽度 const halfWidth = window.innerWidth / 2 const halfHeight = window.innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } //获取到窗口的一半高度和一半宽度 const halfWidth = window.innerWidth / 2 const halfHeight = window.innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } const halfWidth = window.innerWidth / 2 const halfHeight = window.innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } const halfWidth = window.innerWidth / 2 const halfHeight = window.innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } halfWidth = window.innerWidth / 2 const halfHeight = window.innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } = window.innerWidth / 2 const halfHeight = window.innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } window.innerWidth / 2 const halfHeight = window.innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } .innerWidth / 2 const halfHeight = window.innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } innerWidth / 2 const halfHeight = window.innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } / 2 const halfHeight = window.innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } 2 const halfHeight = window.innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } 2 const halfHeight = window.innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } const halfHeight = window.innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } const halfHeight = window.innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } halfHeight = window.innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } = window.innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } window.innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } .innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } innerHeight / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } / 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } 2 const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } const vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } vector1 = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } = point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } point.project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } .project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } project(this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } (this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } this.camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } .camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } camera.threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } .threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } threeCamera) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } ) return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } return [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } [vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } vector1.x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } .x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } x * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } * halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } halfWidth + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } + halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } halfWidth, -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } , -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } -vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } vector1.y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } .y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } y * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } * halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } halfHeight + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } + halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } halfHeight] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } ] } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } // 3d => 2d getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } getFirstIntersectObj(event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } (event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } event) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } ) { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } { if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } if (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } (!event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } !event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } event) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } ) { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } { return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } return } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } //通过鼠标点击的位置计算出raycaster所需要的点的位置,以屏幕中心为原点,值的范围为-1到1. this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } this.raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } .raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } raycaster = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } = new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } new THREE.Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } .Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } Raycaster() const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } () const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } ) const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } const mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } mouse = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } = new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } new THREE.Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } .Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } Vector2() mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } () mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } ) mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } mouse.x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } .x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } x = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } = (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } (event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } event.clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } .clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } clientX / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } / window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } window.innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } .innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } innerWidth) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } ) * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } * 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } 2 - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } - 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } 1 mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } mouse.y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } .y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } y = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } = -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } -(event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } (event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } event.clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } .clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } clientY / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } / window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } window.innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } .innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } innerHeight) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } ) * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } * 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } 2 + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } + 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } 1 // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } // 通过鼠标点的位置和当前相机的矩阵计算出raycaster this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } this.raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } .raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } raycaster.setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } .setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } setFromCamera(mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } (mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } mouse, this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } , this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } this.camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } .camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } camera.threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } .threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } threeCamera) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } ) // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } // 获取raycaster直线和所有模型相交的数组集合 return this.raycaster.intersectObjects(this.scene.children, true)[0].point } return this.raycaster.intersectObjects(this.scene.children, true)[0].point } return this.raycaster.intersectObjects(this.scene.children, true)[0].point } this.raycaster.intersectObjects(this.scene.children, true)[0].point } this.raycaster.intersectObjects(this.scene.children, true)[0].point } .raycaster.intersectObjects(this.scene.children, true)[0].point } raycaster.intersectObjects(this.scene.children, true)[0].point } .intersectObjects(this.scene.children, true)[0].point } intersectObjects(this.scene.children, true)[0].point } (this.scene.children, true)[0].point } this.scene.children, true)[0].point } .scene.children, true)[0].point } scene.children, true)[0].point } .children, true)[0].point } children, true)[0].point } , true)[0].point } true)[0].point } true)[0].point } )[0].point } [0].point } 0].point } ].point } .point } point } } ``` * 添加阴影
```e-cpp // 1、告诉渲染器我需要阴影 renderer.shadowMap.enabled = true; // 2、告诉灯光,我需要阴影: light.castShadow = true; // 3、告诉模型哪些需要投射阴影 cube.castShadow = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; renderer.shadowMap.enabled = true; // 2、告诉灯光,我需要阴影: light.castShadow = true; // 3、告诉模型哪些需要投射阴影 cube.castShadow = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; .shadowMap.enabled = true; // 2、告诉灯光,我需要阴影: light.castShadow = true; // 3、告诉模型哪些需要投射阴影 cube.castShadow = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; shadowMap.enabled = true; // 2、告诉灯光,我需要阴影: light.castShadow = true; // 3、告诉模型哪些需要投射阴影 cube.castShadow = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; .enabled = true; // 2、告诉灯光,我需要阴影: light.castShadow = true; // 3、告诉模型哪些需要投射阴影 cube.castShadow = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; enabled = true; // 2、告诉灯光,我需要阴影: light.castShadow = true; // 3、告诉模型哪些需要投射阴影 cube.castShadow = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; = true; // 2、告诉灯光,我需要阴影: light.castShadow = true; // 3、告诉模型哪些需要投射阴影 cube.castShadow = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; true; // 2、告诉灯光,我需要阴影: light.castShadow = true; // 3、告诉模型哪些需要投射阴影 cube.castShadow = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; true; // 2、告诉灯光,我需要阴影: light.castShadow = true; // 3、告诉模型哪些需要投射阴影 cube.castShadow = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; ; // 2、告诉灯光,我需要阴影: light.castShadow = true; // 3、告诉模型哪些需要投射阴影 cube.castShadow = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; // 2、告诉灯光,我需要阴影: light.castShadow = true; // 3、告诉模型哪些需要投射阴影 cube.castShadow = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; // 2、告诉灯光,我需要阴影: light.castShadow = true; // 3、告诉模型哪些需要投射阴影 cube.castShadow = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; light.castShadow = true; // 3、告诉模型哪些需要投射阴影 cube.castShadow = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; .castShadow = true; // 3、告诉模型哪些需要投射阴影 cube.castShadow = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; castShadow = true; // 3、告诉模型哪些需要投射阴影 cube.castShadow = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; = true; // 3、告诉模型哪些需要投射阴影 cube.castShadow = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; true; // 3、告诉模型哪些需要投射阴影 cube.castShadow = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; true; // 3、告诉模型哪些需要投射阴影 cube.castShadow = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; ; // 3、告诉模型哪些需要投射阴影 cube.castShadow = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; // 3、告诉模型哪些需要投射阴影 cube.castShadow = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; // 3、告诉模型哪些需要投射阴影 cube.castShadow = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; cube.castShadow = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; .castShadow = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; castShadow = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; ; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; // 4、告诉最底下的平面长方形你要接受阴影 plane.receiveShadow = true; plane.receiveShadow = true; .receiveShadow = true; receiveShadow = true; = true; true; true; ; ``` * 场景切换 通过设置 obj 的 visible 属性来达到场景切换的效果 * 使用动画
```e-cpp positionAnimate(obj, targetPosition, i) { new TWEEN.Tween(obj.position) .to( { x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } (obj, targetPosition, i) { new TWEEN.Tween(obj.position) .to( { x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } obj, targetPosition, i) { new TWEEN.Tween(obj.position) .to( { x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } , targetPosition, i) { new TWEEN.Tween(obj.position) .to( { x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } targetPosition, i) { new TWEEN.Tween(obj.position) .to( { x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } , i) { new TWEEN.Tween(obj.position) .to( { x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } i) { new TWEEN.Tween(obj.position) .to( { x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } ) { new TWEEN.Tween(obj.position) .to( { x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } { new TWEEN.Tween(obj.position) .to( { x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } { new TWEEN.Tween(obj.position) .to( { x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } new TWEEN.Tween(obj.position) .to( { x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } new TWEEN.Tween(obj.position) .to( { x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } TWEEN.Tween(obj.position) .to( { x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } .Tween(obj.position) .to( { x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } Tween(obj.position) .to( { x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } (obj.position) .to( { x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } obj.position) .to( { x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } .position) .to( { x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } position) .to( { x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } ) .to( { x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } .to( { x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } .to( { x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } to( { x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } ( { x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } { x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } { x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } x: targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } : targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } targetPosition[0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } [0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } 0], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } ], y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } , y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } y: targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } : targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } targetPosition[1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } [1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } 1], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } ], z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } , z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } z: targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } : targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } targetPosition[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } [2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } 2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } ] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } , 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } (TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } TWEEN.Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } .Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } Easing.Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } .Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } Quadratic.Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } .Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } Out) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } ) .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } .delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } delay(200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } (200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } 200 * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } * i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } i + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } + 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } 1500) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } ) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } () } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } ) } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } scaleAnimate(obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } (obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } obj, targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } , targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } targetScale, i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } , i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } i) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } ) { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } { new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } new TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } TWEEN.Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } .Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } Tween(obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } (obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } obj.scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } .scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } scale) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } ) .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } .to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } to( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } ( { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } { x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } x: targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } : targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } targetScale[0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } [0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } 0], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } ], y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } , y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } y: targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } : targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } targetScale[1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } [1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } 1], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } ], z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } , z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } z: targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } : targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } targetScale[2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } [2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } 2] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } ] }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } }, 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } , 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } 2000 ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } ) .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } .easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } easing(TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } (TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } TWEEN.Easing.Quadratic.Out) .delay(200 * i) .start() } .Easing.Quadratic.Out) .delay(200 * i) .start() } Easing.Quadratic.Out) .delay(200 * i) .start() } .Quadratic.Out) .delay(200 * i) .start() } Quadratic.Out) .delay(200 * i) .start() } .Out) .delay(200 * i) .start() } Out) .delay(200 * i) .start() } ) .delay(200 * i) .start() } .delay(200 * i) .start() } .delay(200 * i) .start() } delay(200 * i) .start() } (200 * i) .start() } 200 * i) .start() } * i) .start() } * i) .start() } i) .start() } ) .start() } .start() } .start() } start() } () } ) } } } ``` * 控制相机移动
```e-undefined ``` * 添加物体选中效果
```e-kotlin import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js' import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js' import { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass.js' //1、添加 EffectComposer,并添加 outlinePass 特效 useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js' import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js' import { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass.js' //1、添加 EffectComposer,并添加 outlinePass 特效 useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]{ EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js' import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js' import { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass.js' //1、添加 EffectComposer,并添加 outlinePass 特效 useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js' import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js' import { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass.js' //1、添加 EffectComposer,并添加 outlinePass 特效 useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]} from 'three/examples/jsm/postprocessing/EffectComposer.js' import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js' import { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass.js' //1、添加 EffectComposer,并添加 outlinePass 特效 useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] from 'three/examples/jsm/postprocessing/EffectComposer.js' import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js' import { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass.js' //1、添加 EffectComposer,并添加 outlinePass 特效 useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]'three/examples/jsm/postprocessing/EffectComposer.js' import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js' import { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass.js' //1、添加 EffectComposer,并添加 outlinePass 特效 useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js' import { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass.js' //1、添加 EffectComposer,并添加 outlinePass 特效 useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js' import { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass.js' //1、添加 EffectComposer,并添加 outlinePass 特效 useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js' import { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass.js' //1、添加 EffectComposer,并添加 outlinePass 特效 useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]{ RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js' import { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass.js' //1、添加 EffectComposer,并添加 outlinePass 特效 useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js' import { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass.js' //1、添加 EffectComposer,并添加 outlinePass 特效 useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]} from 'three/examples/jsm/postprocessing/RenderPass.js' import { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass.js' //1、添加 EffectComposer,并添加 outlinePass 特效 useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] from 'three/examples/jsm/postprocessing/RenderPass.js' import { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass.js' //1、添加 EffectComposer,并添加 outlinePass 特效 useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]'three/examples/jsm/postprocessing/RenderPass.js' import { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass.js' //1、添加 EffectComposer,并添加 outlinePass 特效 useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] import { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass.js' //1、添加 EffectComposer,并添加 outlinePass 特效 useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]import { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass.js' //1、添加 EffectComposer,并添加 outlinePass 特效 useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] { OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass.js' //1、添加 EffectComposer,并添加 outlinePass 特效 useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]{ OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass.js' //1、添加 EffectComposer,并添加 outlinePass 特效 useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] OutlinePass } from 'three/examples/jsm/postprocessing/OutlinePass.js' //1、添加 EffectComposer,并添加 outlinePass 特效 useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]} from 'three/examples/jsm/postprocessing/OutlinePass.js' //1、添加 EffectComposer,并添加 outlinePass 特效 useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] from 'three/examples/jsm/postprocessing/OutlinePass.js' //1、添加 EffectComposer,并添加 outlinePass 特效 useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]'three/examples/jsm/postprocessing/OutlinePass.js' //1、添加 EffectComposer,并添加 outlinePass 特效 useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] //1、添加 EffectComposer,并添加 outlinePass 特效 useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]//1、添加 EffectComposer,并添加 outlinePass 特效 useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]useEffectComposer() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]() { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]) { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] { var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]{ var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]var composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] composer = new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]= new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] new EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]EffectComposer(this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object](this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]this.renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]renderer.threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]threeRenderer) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]) this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]this.composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]composer = composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]= composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] composer var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]var renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] renderPass = new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]= new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] new RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]RenderPass(this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object](this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]this.scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]scene, this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object], this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]this.camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]camera.threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]threeCamera) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]) composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] composer.addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]addPass(renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object](renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]renderPass) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]) var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]var outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] outlinePass = new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]= new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] new OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]OutlinePass( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]( new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] new THREE.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object](window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]window.innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]innerWidth, window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object], window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] window.innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]innerHeight), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]), this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object], this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]this.scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]scene, this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object], this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]this.camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]camera.threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]threeCamera ) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]) outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] outlinePass.visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]visibleEdgeColor.set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]set('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]('#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]'#b8d2eb') outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]) outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] outlinePass.hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]hiddenEdgeColor.set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]set('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]('#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]'#ebd4cd') outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]) outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] outlinePass.edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]edgeStrength = 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]= 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] 5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]5 outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] outlinePass.edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]edgeGlow = 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]= 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] 1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]1 outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] outlinePass.edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]edgeThickness = 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]= 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] 3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]3 outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] outlinePass.pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]pulsePeriod = 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]= 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] 0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]0 this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]this.outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]outlinePass = outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]= outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] outlinePass composer.addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]addPass(outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object](outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]outlinePass) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]) } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] } // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]} // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] // 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]// 2、将 raycaster 选中的物体附加到 outlinePass.selectedObjects 上 const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]const obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] obj = this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]= this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object] this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]this.raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]raycaster.intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]intersectObjects(this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object](this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]this.scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object]scene.children, true)[0] this.outlinePass.selectedObjects = [obj.object].children, true)[0] this.outlinePass.selectedObjects = [obj.object]children, true)[0] this.outlinePass.selectedObjects = [obj.object], true)[0] this.outlinePass.selectedObjects = [obj.object] true)[0] this.outlinePass.selectedObjects = [obj.object]true)[0] this.outlinePass.selectedObjects = [obj.object])[0] this.outlinePass.selectedObjects = [obj.object][0] this.outlinePass.selectedObjects = [obj.object]0] this.outlinePass.selectedObjects = [obj.object]] this.outlinePass.selectedObjects = [obj.object] this.outlinePass.selectedObjects = [obj.object]this.outlinePass.selectedObjects = [obj.object].outlinePass.selectedObjects = [obj.object]outlinePass.selectedObjects = [obj.object].selectedObjects = [obj.object]selectedObjects = [obj.object]= [obj.object] [obj.object][obj.object]obj.object].object]object]] ``` 作者:风之化身呀 链接:https://www.jianshu.com/p/bfea15dcefa4 来源:简书 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
点击查看更多
全部评论
登录
|
注册
关于作者
Terry
TA的个人主页
关注
已关注
文章
52
粉丝
31
获赞
15
评论
8
访问
81672
ThreeJS 轮廓线特效 OutLinePath
创建海洋特效组件 THREEJS 海洋效果 Shader实现
ThreeJS后期处理通道
Three.js物理材质MeshStandardMaterial和MeshPhysicalMaterial
ThreeJs光效流转特效
推荐文章
ThreeJS 轮廓线特效 OutLinePath
(3)、React中使用ECharts——柱状图
31个惊艳的数据可视化作品,让你感受“数据之美”!
防抖节流
创建海洋特效组件 THREEJS 海洋效果 Shader实现
文章目录
文章分享
×
扫一扫分享
复制链接