最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Programming a holeempty space in three.js - Stack Overflow

programmeradmin4浏览0评论

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 badges
Add a ment  | 

1 Answer 1

Reset to default 10

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 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.

发布评论

评论列表(0)

  1. 暂无评论