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

78 lines
2.1 KiB
HTML

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!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; [page:LatheGeometry] &rarr;
<h1>[name]</h1>
<p class="desc">
[name]是一个胶囊图形类通过半径和高度来进行构造。使用lathe来进行构造。
</p>
<iframe
id="scene"
src="scenes/geometry-browser.html#CapsuleGeometry"
></iframe>
<script>
// iOS iframe auto-resize workaround
if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
const scene = document.getElementById( 'scene' );
scene.style.width = getComputedStyle( scene ).width;
scene.style.height = getComputedStyle( scene ).height;
scene.setAttribute( 'scrolling', 'no' );
}
</script>
<h2>代码示例</h2>
<code>
const geometry = new THREE.CapsuleGeometry( 1, 1, 4, 8 );
const material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
const capsule = new THREE.Mesh( geometry, material ); scene.add( capsule );
</code>
<h2>构造函数</h2>
<h3>
[name]([param:Float radius], [param:Float height], [param:Integer capSegments], [param:Integer radialSegments], [param:Integer heightSegments])
</h3>
<p>
radius — 胶囊半径。可选的; 默认值为1。<br />
height — 中间区域的高度。可选的; 默认值为1。<br />
capSegments — 构造盖子的曲线部分的个数。可选的; 默认值为4。<br />
radialSegments — 覆盖胶囊圆周的分离的面的个数。可选的; 默认值为8。<br />
heightSegments — 胶囊侧面沿其高度的段数,默认值为 1。<br />
</p>
<h2>属性</h2>
<p>查看公共属性请参考基类[page:BufferGeometry]。</p>
<h3>[property:Object parameters]</h3>
<p>
有属性的构造函数参数对象。任何实例化之后的修改都不会改变图形。
</p>
<h2>方法</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>