I am learning Three.js. I can't find a proper answer about the difference between CubeGeometry vs BoxGeometry. I am getting the same output for both. Please help.
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);
CubeGeometry is just an alias for BoxGeometry. Keep in mind that CubeGeometry is actually deprecated.
https://github.com/mrdoob/three.js/blob/4888a99ca0161f2b5fea0e9ae9ce845891c50999/src/Three.Legacy.js#L80
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With