You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.0 KiB

2 years ago
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8" />
<base href="../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:BufferGeometry] &rarr;
<h1>多面缓冲几何体([name])</h1>
<p class="desc">
多面体在三维空间中具有一些平面的立体图形。这个类将一个顶点数组投射到一个球面上,之后将它们细分为所需的细节级别。
这个类由[page:DodecahedronGeometry]、[page:IcosahedronGeometry]、[page:OctahedronGeometry]和[page:TetrahedronGeometry]
所使用,以生成它们各自的几何结构。
</p>
<h2>代码示例</h2>
<code>
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 );
</code>
<h2>构造器</h2>
<h3>[name]([param:Array vertices], [param:Array indices], [param:Float radius], [param:Integer detail])</h3>
<p>
vertices — 一个顶点[page:Array](数组):[1,1,1, -1,-1,-1, ... ]。 <br />
indices — 一个构成面的索引[page:Array](数组), [0,1,2, 2,3,0, ... ]。<br />
radius — [page:Float] - 最终形状的半径。<br />
detail — [page:Integer] - 将对这个几何体细分多少个级别。细节越多,形状就越平滑。
</p>
<h2>属性</h2>
<p>共有属性请参见其基类[page:BufferGeometry]。</p>
<h3>[property:Object parameters]</h3>
<p>
一个包含着构造函数中每个参数的对象。在对象实例化之后,对该属性的任何修改都不会改变这个几何体。
</p>
<h2>方法(Methods)</h2>
<p>共有方法请参见其基类[page:BufferGeometry]。</p>
<h2>源代码</h2>
<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</p>
</body>
</html>