CatmullRomCurve3.html 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 using the Catmull-Rom algorithm</div>
  14. <h2>Example</h2>
  15. <code>
  16. //Create a closed wavey loop
  17. var curve = new THREE.CatmullRomCurve3( [
  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. </code>
  28. <h3>[example:webgl_geometry_extrude_splines geometry / extrude / splines]</h3>
  29. <h2>Constructor</h2>
  30. <h3>[name]( [page:Array points] )</h3>
  31. <div>points – An array of [page:Vector3] points</div>
  32. <h2>Properties</h2>
  33. <h3>[property:Array points]</h3>
  34. <h3>[property:Boolean closed] – curve loops back onto itself when true. False by default.</h3>
  35. <h3>[property:String type] - possible values are `centripetal` (default), `chordal` and `catmullrom`
  36. <h3>[property:float tension] - when type is `catmullrom`, defines catmullrom's tension. Defaults to 0.5
  37. <h2>Methods</h2>
  38. <h3>See [page:Curve] for inherited methods</h3>
  39. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  40. </body>
  41. </html>