Spline.html 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. <h1>[name]</h1>
  12. <div class="desc">Represents a spline.</div>
  13. <h2>Constructor</h2>
  14. <h3>[name]( [page:Array points] )</h3>
  15. <div>Initialises the spline with *points*, which are the places through which the spline will go.</div>
  16. <h2>Properties</h2>
  17. <h3>[property:Array points]</h3>
  18. <h2>Methods</h2>
  19. <h3>[method:null initFromArray]( [page:Array a] )</h3>
  20. <div>
  21. a — array of triplets containing x, y, z coordinates<br />
  22. </div>
  23. <div>Initialises using the data in the array as a series of points. Each value in *a* must be another array with three values, where a[n] is v, the value for the *nth* point, and v[0], v[1] and v[2] are the x, y and z coordinates of that point n, respectively.
  24. </div>
  25. <h3>[method:Vector3 getPoint]( [page:Integer k] )</h3>
  26. <div>
  27. k — point index
  28. </div>
  29. <div>Return the interpolated point at *k*.</div>
  30. <h3>[method:Array getControlPointsArray]( )</h3>
  31. <div>Returns an array with triplets of x, y, z coordinates that correspond to the current control points.
  32. </div>
  33. <h3>[method:Object getLength]( [page:Integer nSubDivisions] )</h3>
  34. <div>
  35. nSubDivisions — number of subdivisions between control points. Default is *100*.
  36. </div>
  37. <div>
  38. Returns an object with the two properties. The property .<strong>[page:Number total]</strong> contains
  39. the length of the spline when using nSubDivisions. The property .[page:Array chunkLength]
  40. contains an array with the total length from the beginning of the spline to the end of that chunk.
  41. </div>
  42. <h3>[method:null reparametrizeByArcLength]( [page:Float samplingCoef] )</h3>
  43. <div>
  44. samplingCoef — how many intermediate values to use between spline points
  45. </div>
  46. <div>Modifies the spline so that it looks similar to the original but has its points distributed in such way that moving along the spline it's done at a more or less constant speed. The points should also appear more uniformly spread along the curve.</div>
  47. <div>This is done by resampling the original spline, with the density of sampling controlled by *samplingCoef*. Here it's interesting to note that denser sampling is not necessarily better: if sampling is too high, you may get weird kinks in curvature.</div>
  48. <h2>Source</h2>
  49. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  50. </body>
  51. </html>