CatmullRomCurve3 样条曲线

Curve

绘制3D的样条曲线, 根据 Catmull-Rom 插值算法.

function CatmullRomCurve3( points, closed, curveType, tension ) { } var controlPoints = [new THREE.Vector3(-10, 0, 5), new THREE.Vector3(-5, 5, 0), new THREE.Vector3(0, 0, 5), new THREE.Vector3(5, 5, 0), new THREE.Vector3(10, 0, 5)]; var curve = new THREE.CatmullRomCurve3( controlPoints); var geometry = new THREE.Geometry(); geometry.vertices = curve.getPoints(50); var material = new THREE.LineBasicMaterial( { color : 0xff0000 }), line = new THREE.Line( geometry, material ); scene.add(line);

Attributes

type : String

Default value : 'CatmullRomCurve3'
Description : 类型

points : Array

Default value : []
Description : 点集.

closed : Boolean

Default value : false
Description : 是否闭合.

curveType : String

Default value : 'centripetal'
Description : 曲线类型, 包含 'centripetal', 'chordal', 'catmullrom'.

tension : Float

Default value : 0.5
Description : 拉伸度.

isCatmullRomCurve3 : Boolean

Default value : true
Description : 类型是否为CatmullRomCurve3