SplineCurve.html 1.2 KB

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