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 :)
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 :)
Share Improve this question asked Aug 1, 2012 at 21:28 ApplecowApplecow 8423 gold badges15 silver badges39 bronze badges1 Answer
Reset to default 10If you are looking to "cut" things out in certain shapes, you may be interested in this post on a Constructive Solid Geometry library. It es 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.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744218675a4563675.html
评论列表(0条)