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 | <h1>[name]</h1>
|
---|
11 |
|
---|
12 | <div class="desc">Represents a spline.</div>
|
---|
13 |
|
---|
14 |
|
---|
15 | <h2>Constructor</h2>
|
---|
16 |
|
---|
17 |
|
---|
18 | <h3>[name]( [page:Array points] )</h3>
|
---|
19 |
|
---|
20 | <div>Initialises the spline with *points*, which are the places through which the spline will go.</div>
|
---|
21 |
|
---|
22 |
|
---|
23 | <h2>Properties</h2>
|
---|
24 |
|
---|
25 | <h3>.[page:Array points]</h3>
|
---|
26 |
|
---|
27 |
|
---|
28 | <h2>Methods</h2>
|
---|
29 |
|
---|
30 | <h3>.initFromArray( [page:Array a] )</h3>
|
---|
31 | <div>
|
---|
32 | a â array of triplets containing x, y, z coordinates<br />
|
---|
33 | </div>
|
---|
34 | <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.
|
---|
35 | </div>
|
---|
36 |
|
---|
37 | <h3>.getPoint( [page:Integer k] )</h3>
|
---|
38 | <div>
|
---|
39 | k â point index
|
---|
40 | </div>
|
---|
41 | <div>Return the interpolated point at *k*.</div>
|
---|
42 |
|
---|
43 | <h3>.getControlPointsArray( )</h3>
|
---|
44 | <div>Returns an array with triplets of x, y, z coordinates that correspond to the current control points.
|
---|
45 | </div>
|
---|
46 |
|
---|
47 | <h3>.getLength( [page:Integer nSubDivisions] )</h3>
|
---|
48 | <div>
|
---|
49 | nSubDivisions â number of subdivisions between control points. Default is *100*.
|
---|
50 | </div>
|
---|
51 | <div>Returns the length of the spline when using nSubDivisions.</div>
|
---|
52 |
|
---|
53 | <h3>.reparametrizeByArcLength( [page:Float samplingCoef] )</h3>
|
---|
54 | <div>
|
---|
55 | samplingCoef â how many intermediate values to use between spline points
|
---|
56 | </div>
|
---|
57 | <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>
|
---|
58 | <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>
|
---|
59 |
|
---|
60 | <h2>Source</h2>
|
---|
61 |
|
---|
62 | [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
|
---|
63 | </body>
|
---|
64 | </html>
|
---|