SplineCurve3.html 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 3d spline curve from a series of points. Internally this uses
  15. [page:CurveUtils.interpolate] to create the curve.<br /><br />
  16. Note that this will be deprecated. Please use a [page:CatmullRomCurve3] instead.
  17. </div>
  18. <h2>Example</h2>
  19. <div>[example:webgl_geometry_extrude_splines geometry / extrude / splines ] (choose PipeSpline)</div>
  20. <code>
  21. //Create a closed bent a sine-like wave
  22. var curve = new THREE.SplineCurve3( [
  23. new THREE.Vector3( -10, 0, 10 ),
  24. new THREE.Vector3( -5, 5, 5 ),
  25. new THREE.Vector3( 0, 0, 0 ),
  26. new THREE.Vector3( 5, -5, 5 ),
  27. new THREE.Vector3( 10, 0, 10 )
  28. ] );
  29. var geometry = new THREE.Geometry();
  30. geometry.vertices = curve.getPoints( 50 );
  31. var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
  32. //Create the final object to add to the scene
  33. var splineObject = new THREE.Line( geometry, material );
  34. </code>
  35. <h2>Constructor</h2>
  36. <h3>[name]( [page:Array points] )</h3>
  37. <div>points – An array of [page:Vector3] points that define the curve.</div>
  38. <h2>Properties</h2>
  39. <h3>[property:Array points]</h3>
  40. <h2>Methods</h2>
  41. <h3>See [page:Curve] for inherited methods</h3>
  42. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  43. </body>
  44. </html>