Create a smooth 2d spline curve from a series of points. Internally this uses [page:Interpolations.CatmullRom] to create the curve.
// 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 points = curve.getPoints(50);
var geometry = new v3d.BufferGeometry().setFromPoints(points);
var material = new v3d.LineBasicMaterial({ color : 0xff0000 });
// Create the final object to add to the scene
var splineObject = new v3d.Line(geometry, material);
points – An array of [page:Vector2] points that define the curve.
See the base [page:Curve] class for common properties.
Used to check whether this or derived classes are SplineCurves. Default is *true*.
You should not change this, as it used internally for optimisation.
The array of [page:Vector2] points that define the curve.
See the base [page:Curve] class for common methods.
[sourceHint]