Create a smooth 3d cubic bezier curve, defined by a start point, endpoint and two control points.
var curve = new v3d.CubicBezierCurve3(
new v3d.Vector3(-10, 0, 0),
new v3d.Vector3(-5, 15, 0),
new v3d.Vector3(20, 15, 0),
new v3d.Vector3(10, 0, 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 curveObject = new v3d.Line(geometry, material);
[page:Vector3 v0] – The starting point.
[page:Vector3 v1] – The first control point.
[page:Vector3 v2] – The second control point.
[page:Vector3 v3] – The ending point.
See the base [page:Curve] class for common properties.
Used to check whether this or derived classes are CubicBezierCurve3s. Default is *true*.
You should not change this, as it used internally for optimisation.
The starting point.
The first control point.
The second control point.
The ending point.
See the base [page:Curve] class for common Methods.
[sourceHint]