[page:Curve] →

样条曲线([name])

从一系列的点中,创建一个平滑的二维样条曲线。内部使用[page:Interpolations.CatmullRom]来创建曲线。

示例

// Create a sine-like wave var curve = new v3d.SplineCurve([ new v3d.Vector2(-10, 0), new v3d.Vector2(-5, 5), new v3d.Vector2(0, 0), new v3d.Vector2(5, -5), new v3d.Vector2(10, 0) ]); var points = curve.getPoints(50); var geometry = new v3d.BufferGeometry().setFromPoints(points); var material = new v3d.LineBasicMaterial({ color : 0xff0000 }); // Create the final object to add to the scene var splineObject = new v3d.Line(geometry, material);

构造函数

[name]([param:Array points])

points – 定义曲线的[page:Vector2]点的数组。

属性

请参阅其基类[page:Curve]来了解共有属性。

[property:Boolean isSplineCurve]

用于检查该类或者其派生类是否为样条曲线。默认值为*true*。

你不应当对这一属性进行改变,它在内部使用,以用于优化。

[property:Array points]

定义这一曲线的[page:Vector2]点的数组。

方法

请参阅其基类[page:Curve]来了解共有方法。

源代码

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