SplineCurve.html 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. [page:Curve] &rarr;
  12. <h1>样条曲线([name])</h1>
  13. <p class="desc">
  14. 从一系列的点中,创建一个平滑的二维样条曲线。内部使用[page:Interpolations.CatmullRom]来创建曲线。
  15. </p>
  16. <h2>示例</h2>
  17. <code>
  18. // Create a sine-like wave
  19. var curve = new THREE.SplineCurve( [
  20. new THREE.Vector2( -10, 0 ),
  21. new THREE.Vector2( -5, 5 ),
  22. new THREE.Vector2( 0, 0 ),
  23. new THREE.Vector2( 5, -5 ),
  24. new THREE.Vector2( 10, 0 )
  25. ] );
  26. var points = curve.getPoints( 50 );
  27. var geometry = new THREE.BufferGeometry().setFromPoints( points );
  28. var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
  29. // Create the final object to add to the scene
  30. var splineObject = new THREE.Line( geometry, material );
  31. </code>
  32. <h2>构造函数</h2>
  33. <h3>[name]( [param:Array points] )</h3>
  34. <p>points – 定义曲线的[page:Vector2]点的数组。</p>
  35. <h2>属性</h2>
  36. <p>共有属性请参见其基类[page:Curve]。</p>
  37. <h3>[property:Boolean isSplineCurve]</h3>
  38. <p>
  39. 用于检查该类或者其派生类是否为样条曲线。默认值为*true*。<br /><br />
  40. 你不应当对这一属性进行改变,它在内部使用,以用于优化。
  41. </p>
  42. <h3>[property:Array points]</h3>
  43. <p>定义这一曲线的[page:Vector2]点的数组。</p>
  44. <h2>方法</h2>
  45. <p>共有方法请参见其基类[page:Curve]。</p>
  46. <h2>源代码</h2>
  47. <p>
  48. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  49. </p>
  50. </body>
  51. </html>