[page:BufferGeometry] →
[name]
A polyhedron is a solid in three dimensions with flat faces. This class will take an array of vertices,
project them onto a sphere, and then divide them up to the desired level of detail. This class is used
by [page:DodecahedronBufferGeometry], [page:IcosahedronBufferGeometry], [page:OctahedronBufferGeometry],
and [page:TetrahedronBufferGeometry] to generate their respective geometries.
Example
var 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,
];
var 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
];
var geometry = new THREE.PolyhedronBufferGeometry( verticesOfCube, indicesOfFaces, 6, 2 );
Constructor
[name]([page:Array vertices], [page:Array faces], [page:Float radius], [page:Integer detail])
vertices — [page:Array] of points of the form [1,1,1, -1,-1,-1, ... ]
faces — [page:Array] of indices that make up the faces of the form [0,1,2, 2,3,0, ... ]
radius — [page:Float] - The radius of the final shape
detail — [page:Integer] - How many levels to subdivide the geometry. The more detail, the smoother the shape.
Properties
[property:Object parameters]
An object with all of the parameters that were used to generate the geometry.
Source
[link:https://github.com/mrdoob/three.js/blob/master/src/geometries/PolyhedronGeometry.js src/geometries/PolyhedronGeometry.js]