首先,我使用:
npm install three --save
npm install @types/three
npm install three-js-csg --save之后:
import * as THREE from 'three';
import * as csg from 'three-js-csg';
let sphere1BSP = new csg(sphere1);
let cube2BSP = new csg(cube);
let resultBSP = sphere1BSP.subtract(cube2BSP);但它被抛到了异常之下:
core.js:1633错误:未知(承诺):TypeError: sphere1BSP.subtract不是函数
发布于 2018-08-28 03:37:12
基于npm页面:https://www.npmjs.com/package/three-js-csg,您可能需要用三实例化‘3-js-csg’。
import THREE from 'three';
import * as csg from 'three-js-csg';
const ThreeBSG = csg(THREE);我没有测试这个,所以我可能弄错了。
https://stackoverflow.com/questions/52049679
复制相似问题