Curve →
CatmullRomCurve3
Create a smooth 3d spline curve from a series of points using the Catmull-Rom algorithm
Example
//Create a closed wavey loop var curve = new THREE.CatmullRomCurve3( [ new THREE.Vector3( -10, 0, 10 ), new THREE.Vector3( -5, 5, 5 ), new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 5, -5, 5 ), new THREE.Vector3( 10, 0, 10 ) ] ); var geometry = new THREE.Geometry(); geometry.vertices = curve.getPoints( 50 ); var material = new THREE.LineBasicMaterial( { color : 0xff0000 } );
Constructor
CatmullRomCurve3( points )
points – An array of
Vector3 points
Properties
# .closed – curve loops back onto itself when true. False by default.
# .type - possible values are `centripetal` (default), `chordal` and `catmullrom`
# .tension - when type is `catmullrom`, defines catmullrom's tension. Defaults to 0.5
Methods
See Curve for inherited methods
src/extras/curves/CatmullRomCurve3.js
Edit