Three.js中的CubeGeometry VS BoxGeometry?

时间:2018-07-30 07:01:44

标签: three.js

我正在学习Three.js。我找不到有关CubeGeometry与BoxGeometry之间差异的正确答案。我两个都得到相同的输出。请帮忙。

**CubeGeometry:**
var geomatry = new THREE.CubeGeometry(100,100,100);
var material = new THREE.MeshLambertMaterial({color:0XF3FFE2});
var mesh = new THREE.Mesh(geomatry,material);
mesh.position.set(0,0,-1000);
scene.add(mesh);

**BoxGeometry:**
var geomatry = new THREE.BoxGeometry(100,100,100);
var material = new THREE.MeshLambertMaterial({color:0XF3FFE2});
var mesh = new THREE.Mesh(geomatry,material);
mesh.position.set(0,0,-1000);
scene.add(mesh);

1 个答案:

答案 0 :(得分:2)

CubeGeometry只是BoxGeometry的别名。请记住,CubeGeometry实际上已被弃用。

https://github.com/mrdoob/three.js/blob/4888a99ca0161f2b5fea0e9ae9ce845891c50999/src/Three.Legacy.js#L80