【发布时间】:2019-09-14 03:01:18
【问题描述】:
我在 Angular 7 中使用 ng2-adsk-forge-viewer 库在浏览器中显示 dmg 文件。我想在视图上创建自定义几何图形。
我创建了一个扩展并添加了这个方法。扩展运行正常,但出现错误
private addToScene() {
const geom = new THREE.SphereGeometry(10, 8, 8);
const material = new THREE.MeshBasicMaterial({ color: 0xff0000 });
const sphereMesh = new THREE.Mesh(geom, material);
sphereMesh.position.set(1, 2, 3);
this.viewer.impl.createOverlayScene('custom-scene');
this.viewer.impl.addOverlay('custom-scene', sphereMesh);
this.viewer.impl.invalidate(true);
}
我收到此错误消息
three.js:35 THREE.Object3D.add:对象不是 THREE.Object3D 的实例。 Mesh {uuid: "1CA8B8ED-5370-45FE-B20C-BB6AF483716E", name: "", type: "Mesh", parent: null, children: Array(0), ...}
【问题讨论】: