SplineCurve.html 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <script src="../../../list.js"></script>
  6. <script src="../../../page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="../../../page.css" />
  8. </head>
  9. <body>
  10. [page:Curve] &rarr;
  11. <h1>[name]</h1>
  12. <div class="desc">Create a smooth 2d spline curve from a series of points</div>
  13. <h2>Example</h2>
  14. <code>
  15. //Create a sine-like wave
  16. var curve = new THREE.SplineCurve([
  17. new THREE.Vector2(-10, 0),
  18. new THREE.Vector2(-5, 5),
  19. new THREE.Vector2( 0, 0),
  20. new THREE.Vector2( 5, -5),
  21. new THREE.Vector2(10, 0)
  22. ]);
  23. var path = new THREE.Path( curve.getPoints(50) );
  24. var geometry = path.createPointsGeometry( 50 );
  25. var material = new THREE.LineBasicMaterial( { color: 0xff0000 } );
  26. var object3d = new THREE.Line( geometry, material );
  27. </code>
  28. <h2>Constructor</h2>
  29. <h3>[name]([page:Array points])</h3>
  30. <div>points – An array of [page:Vector2] points</div>
  31. <h2>Properties</h2>
  32. <h3>[property:Array points]</h3>
  33. <h2>Methods</h2>
  34. <h3>See [page:Curve] for inherited methods</h3>
  35. <h2>Source</h2>
  36. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  37. </body>
  38. </html>