SplineCurve3.html 1.3 KB

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