[page:Curve] →
[name]
Create a smooth 3d spline curve from a series of points using the
[link:https://en.wikipedia.org/wiki/Centripetal_Catmull-Rom_spline Catmull-Rom] algorithm.
Example
//Create a closed wavey loop
var curve = new v3d.CatmullRomCurve3([
new v3d.Vector3(-10, 0, 10),
new v3d.Vector3(-5, 5, 5),
new v3d.Vector3(0, 0, 0),
new v3d.Vector3(5, -5, 5),
new v3d.Vector3(10, 0, 10)
]);
var geometry = new v3d.Geometry();
geometry.vertices = curve.getPoints(50);
var material = new v3d.LineBasicMaterial({ color : 0xff0000 });
// Create the final object to add to the scene
var curveObject = new v3d.Line(geometry, material);
[example:webgl_geometry_extrude_splines geometry / extrude / splines]
Constructor
[name]([page:Array points])
points – An array of [page:Vector3] points
Properties
See the base [page:Curve] class for common properties.
[property:Array points]
The array of array of [page:Vector3] points that define the curve.
[property:Boolean closed]
The curve will loop back onto itself when this is true. False by default
[property:String type]
Possible values are `centripetal` (default), `chordal` and `catmullrom`.
[property:float tension]
When [page:.type] is `catmullrom`, defines catmullrom's tension. Defaults is *0.5*.
Methods
See the base [page:Curve] class for common methods.
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]