SplineCurve.html 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. // Create the final Object3d to add to the scene
  27. var splineObject = new THREE.Line( geometry, material );
  28. </code>
  29. <h2>Constructor</h2>
  30. <h3>[name]( [page:Array points] )</h3>
  31. <div>points – An array of [page:Vector2] points</div>
  32. <h2>Properties</h2>
  33. <h3>[property:Array points]</h3>
  34. <h2>Methods</h2>
  35. <h3>See [page:Curve] for inherited methods</h3>
  36. <h2>Source</h2>
  37. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  38. </body>
  39. </html>