CubicBezierCurve 三次贝塞尔曲线

—> Curve

2D的三次贝塞尔曲线. 有两个控制点, 即比 QuadraticBezierCurve 多了一个控制点.

function CubicBezierCurve( v0, v1, v2, v3 ) { } var v1 = new THREE.Vector2(-3, 0), v2 = new THREE.Vector2(-1, -4), v3 = new THREE.Vector2(1, 4), v4 = new THREE.Vector2(3, 0); var curve = new THREE.CubicBezierCurve(v1, v2, v3, v4), points = curve.getPoints(60); var geometry = new THREE.Geometry().setFromPoints(points), material = new THREE.LineBasicMaterial({ color: '#ff9900'}), line = new THREE.Line(geometry, material); scene.add(line);

Attributes

type : String

Default value : 'CubicBezierCurve'
Description : 类型

v0 : Vector2

Default value : new Vector2()
Description : 起点.

v1 : Vector2

Default value : new Vector2()
Description : 第1个控制点.

v2 : Vector2

Default value : new Vector2()
Description : 第2个控制点.

v3 : Vector2

Default value : new Vector2()
Description : 终点.

isCubicBezierCurve : Boolean

Default value : true
Description : 类型是否为 CubicBezierCurve.

图解API