SplineCurve.html 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. <div class="desc">
  14. Create a smooth 2d spline curve from a series of points. Internally this uses
  15. [page:CurveUtils.interpolate] to create the curve.
  16. </div>
  17. <h2>Example</h2>
  18. <code>
  19. // Create a sine-like wave
  20. var curve = new THREE.SplineCurve( [
  21. new THREE.Vector2( -10, 0 ),
  22. new THREE.Vector2( -5, 5 ),
  23. new THREE.Vector2( 0, 0 ),
  24. new THREE.Vector2( 5, -5 ),
  25. new THREE.Vector2( 10, 0 )
  26. ] );
  27. var path = new THREE.Path( curve.getPoints( 50 ) );
  28. var geometry = path.createPointsGeometry( 50 );
  29. var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
  30. // Create the final object to add to the scene
  31. var splineObject = new THREE.Line( geometry, material );
  32. </code>
  33. <h2>Constructor</h2>
  34. <h3>[name]( [page:Array points] )</h3>
  35. <div>points – An array of [page:Vector2] points that define the curve.</div>
  36. <h2>Properties</h2>
  37. <div>See the base [page:Curve] class for common properties.</div>
  38. <h3>[property:Array points]</h3>
  39. <div>The array of [page:Vector3] points that define the curve.</div>
  40. <h2>Methods</h2>
  41. <div>See the base [page:Curve] class for common methods.</div>
  42. <h2>Source</h2>
  43. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  44. </body>
  45. </html>