Three.js - Why is csg.js not working?

做~自己de王妃 提交于 2019-12-02 04:33:32

The article is outdated, this is the new syntax:

var box = new THREE.Mesh( new THREE.BoxGeometry( 10, 1, 10 ) );
var box_bsp = new ThreeBSP( box );

var cutgeo = new THREE.SphereGeometry( 1, 16, 8 );
var sub = new THREE.Mesh( cutgeo );
var subtract_bsp  = new ThreeBSP( sub );
var result_bsp  = box_bsp.subtract( substract_bsp );

var result = result_bsp.toMesh();
scene.add( result );

Three.js r107: http://jsfiddle.net/r7suq1mv/2/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!