[page:Curve] →

二维三次贝塞尔曲线([name])

创建一条平滑的二维 三次贝塞尔曲线, 由起点、终点和两个控制点所定义。

代码示例

const curve = new THREE.CubicBezierCurve( new THREE.Vector2( -10, 0 ), new THREE.Vector2( -5, 15 ), new THREE.Vector2( 20, 15 ), new THREE.Vector2( 10, 0 ) ); const points = curve.getPoints( 50 ); const geometry = new THREE.BufferGeometry().setFromPoints( points ); const material = new THREE.LineBasicMaterial( { color: 0xff0000 } ); // Create the final object to add to the scene const curveObject = new THREE.Line( geometry, material );

构造函数

[name] ( [param:Vector2 v0], [param:Vector2 v1], [param:Vector2 v2], [param:Vector2 v3] )

[page:Vector2 v0] – 起点
[page:Vector2 v1] – 第一个控制点
[page:Vector2 v2] – 第二个控制点
[page:Vector2 v3] – 终点

属性

共有属性请参见其基类[page:Curve]。

[property:Vector2 v0]

起点

[property:Vector2 v1]

第一个控制点

[property:Vector2 v2]

第二个控制点

[property:Vector2 v3]

终点

方法

共有方法请参见其基类[page:Curve]。

源代码

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]