创建一条平滑的三维 二次贝塞尔曲线, 由起点、终点和一个控制点所定义。
const curve = new THREE.QuadraticBezierCurve3(
new THREE.Vector3( -10, 0, 0 ),
new THREE.Vector3( 20, 15, 0 ),
new THREE.Vector3( 10, 0, 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 );
[page:Vector3 v0] – 起点
[page:Vector3 v1] – 中间的控制点
[page:Vector3 v2] – 终点
共有属性请参见其基类[page:Curve]。
起点
控制点
终点
共有方法请参见其基类[page:Curve]。
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]