Click or drag to resize
Ab4d.SharpEngine logo

BezierCurveCreateBezierCurvePositions(Vector3, Single, Single, Int32) Method

Returns an array of 3D points that define the Bezier curve with the specified control points (i.e., positions of points on the curve and tangent control points). The curve positions are created using an adaptive algorithm that adds more points where the curvature is higher. This takes longer to compute than when using fixed positionsPerSegment, but generates smoother curves with less positions.

Namespace: Ab4d.SharpEngine.Utilities
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 4.1.9680+a1b1e43de1ad9a7e35472c33948d688d7b40ef79
Syntax
C#
public static Vector3[] CreateBezierCurvePositions(
	Vector3[] controlPoints,
	float angleThresholdDegrees,
	float minSegmentLength,
	int maxSubdivisionsCount = 6
)

Parameters

controlPoints  Vector3
Array of control points (positions of points on the curve and tangent control points).
angleThresholdDegrees  Single
Angle threshold in degrees. Lower values produce more accurate curve.
minSegmentLength  Single
Minimum segment length. Lower values produce more accurate curve.
maxSubdivisionsCount  Int32  (Optional)
maximum number of recursive subdivisions per segment (6 by default that produces at max 64 positions per segment)

Return Value

Vector3
A Vector3[] array that defines the Bezier curve.
See Also