SplineCurve3.html 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 3d spline curve from a series of points</div>
  13. <h2>Example</h2>
  14. <code>
  15. //Create a closed bent a sine-like wave
  16. var curve = new THREE.SplineCurve3( [
  17. new THREE.Vector3( -10, 0, 10 ),
  18. new THREE.Vector3( -5, 5, 5 ),
  19. new THREE.Vector3( 0, 0, 0 ),
  20. new THREE.Vector3( 5, -5, 5 ),
  21. new THREE.Vector3( 10, 0, 10 )
  22. ] );
  23. var geometry = new THREE.Geometry();
  24. geometry.vertices = curve.getPoints( 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. <h3>[example:webgl_geometry_extrude_splines geometry / extrude / splines ] (choose PipeSpline)</h3>
  30. <h2>Constructor</h2>
  31. <h3>[name]( [page:Array points] )</h3>
  32. <div>points – An array of [page:Vector3] 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. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  38. </body>
  39. </html>