My BoundingBox就像:http://i.stack.imgur.com/IGmxF.png,我不想在框内显示三角形,我该如何删除这些线?感谢。
var bbox = new THREE.BoundingBoxHelper(object3d, new THREE.Color(0xFF9900));
bbox.visible = false;
bbox.name = "BBOX"
bbox.update();
object3d.children[0] = bbox;
scene.add(bbox);
答案 0 :(得分:2)
编辑:BoundingBoxHelper
已被弃用。您现在可以使用此模式:
// box helper
boxHelper = new THREE.BoxHelper( parent );
boxHelper.material.color.set( 0xffffff );
scene.add( boxHelper );
在渲染循环中,您可能必须这样做:
boxHelper.update();
three.js r.85
答案 1 :(得分:1)
现在from three.js r72 a THREE.BoxHelper
class正是您所需要的。它会给你一个没有对角线的线框:
var helper = new THREE.BoxHelper( object );
scene.add( helper );
答案 2 :(得分:0)
使用BoundingBox获取场景的尺寸,并将其应用于带有线框材质的BoxGeometry
。 BoxGeometry
里面没有三角形。