使用three.js从中切出切片的圆柱体最简单的方法是什么? [英] What is the simplest way to draw a cylinder with a slice cut out of it with three.js?
本文介绍了使用three.js从中切出切片的圆柱体最简单的方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道如何使用three.js绘制一个带有切片的圆柱体,如下所示:图片
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
非常感谢所有回复。
推荐答案
获得你想要的形状的最简单方法可能是挤出 THREE.Shape
,如下所示:
Probably the easiest way to get the shape you want is to extrude a THREE.Shape
like so:
var settings = {
amount: 2,
steps : 1,
bevelEnabled: false,
curveSegments: 24
};
var shape = new THREE.Shape();
shape.moveTo( 0, 0 );
shape.absarc( 0, 0, 10, 0, Math.PI * 1.75, false );
shape.moveTo( 0, 0 );
var geometry = new THREE.ExtrudeGeometry( shape, settings );
小提琴: http://jsfiddle.net/0yyg5ese/
three.js r.73
three.js r.73
这篇关于使用three.js从中切出切片的圆柱体最简单的方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文