[page:Curve] →
[name]
Create a smooth 2d spline curve from a series of points. Internally this uses
[page:Interpolations.CatmullRom] to create the curve.
Example
// Create a sine-like wave
var curve = new v3d.SplineCurve([
new v3d.Vector2(-10, 0),
new v3d.Vector2(-5, 5),
new v3d.Vector2(0, 0),
new v3d.Vector2(5, -5),
new v3d.Vector2(10, 0)
]);
var path = new v3d.Path(curve.getPoints(50));
var geometry = path.createPointsGeometry(50);
var material = new v3d.LineBasicMaterial({ color : 0xff0000 });
// Create the final object to add to the scene
var splineObject = new v3d.Line(geometry, material);
Constructor
[name]([page:Array points])
points – An array of [page:Vector2] points that define the curve.
Properties
See the base [page:Curve] class for common properties.
[property:Array points]
The array of [page:Vector3] points that define the curve.
Methods
See the base [page:Curve] class for common methods.
[sourceHint]