获取指定参数值处的曲线斜率。
curve.getTangentAt( u )
u
— 曲线参数值,范围从0到1。返回一个THREE.Vector3对象,表示曲线在指定参数值处的切线。
// 创建一个二次贝塞尔曲线
var curve = new THREE.QuadraticBezierCurve(
new THREE.Vector3( -10, 0, 0 ),
new THREE.Vector3( 0, 10, 0 ),
new THREE.Vector3( 10, 0, 0 )
);
// 获取曲线参数值为0.5处的切线
var tangent = curve.getTangentAt( 0.5 );
console.log( "tangent:", tangent );