What is the simplest way to draw a cylinder with a slice cut out of it with three.js?

后端 未结 2 1190
情歌与酒
情歌与酒 2021-01-24 01:35

I was wondering how you would draw a cylinder with a slice cut out of it using three.js i.e. something like this: Image

All replies are much appreciated.

2条回答
  •  無奈伤痛
    2021-01-24 02:08

    Use a THREE.CylinderGeometry and set the thetaLength-parameter. The default is 2 * Pi, which makes for a complete cylinder. I have built a fiddle that looks like your Image: http://jsfiddle.net/hvgropoa/.

    Downside: the slice´s faces ar missing, so you can see inside the cylinder when looking inside the cut :( However this is the simplest way, if you need a closed Cylinder I suggest doing it with THREE.CSG.

提交回复
热议问题