i'd like to programm something like a hole in three.js. it should be like, e.g. a 3x3x3 cube with an 1x1x1 hole in it. is there a possibility, that i first use something like cubegeometry and afterwards another "geometry" that cuts out the stuff that i want to have deleted? an deletion geometry? :D
Thanks :)
If you are looking to "cut" things out in certain shapes, you may be interested in this post on a Constructive Solid Geometry library. It comes with a wrapper for THREE.js objects.
It lets you do things like this:
var cube = new CSG.cube();
var sphere = CSG.sphere({radius: 1.3, stacks: 16});
var geometry = cube.subtract(sphere);
=>
Here is another short tutorial on the subject.
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