PolyhedronGeometry(多面缓冲几何体)
小于 1 分钟约 260 字
PolyhedronGeometry
const verticesOfCube = [
-1,-1,-1, 1,-1,-1, 1, 1,-1, -1, 1,-1,
-1,-1, 1, 1,-1, 1, 1, 1, 1, -1, 1, 1,
];
const indicesOfFaces = [
2,1,0, 0,3,2,
0,4,7, 7,3,0,
0,1,5, 5,4,0,
1,2,6, 6,5,1,
2,3,7, 7,6,2,
4,5,6, 6,7,4
];
const geometry = new THREE.PolyhedronGeometry( verticesOfCube, indicesOfFaces, 6, 2 );
构造器
vertices : Array
一个顶点Array(数组):[1,1,1, -1,-1,-1, ... ]
indices : Array
一个构成面的索引Array(数组), [0,1,2, 2,3,0, ... ]
radius : Float
最终形状的半径
detail : Integer
将对这个几何体细分多少个级别。细节越多,形状就越平滑
属性
共有属性请参见其基类BufferGeometry
.parameters : Object
一个包含着构造函数中每个参数的对象。在对象实例化之后,对该属性的任何修改都不会改变这个几何体
方法
共有方法请参见其基类BufferGeometry