public class BezierFunction
extends java.lang.Object
Constructor and Description |
---|
BezierFunction(org.apache.commons.math3.geometry.euclidean.threed.Vector3D p0,
org.apache.commons.math3.geometry.euclidean.threed.Vector3D p1,
org.apache.commons.math3.geometry.euclidean.threed.Vector3D p2,
org.apache.commons.math3.geometry.euclidean.threed.Vector3D p3) |
Modifier and Type | Method and Description |
---|---|
org.apache.commons.math3.geometry.euclidean.threed.Vector3D |
calculateBezierPoint(float t)
Calculates a point in 3D space that resembles a point on a 3D Bezier
curve.
|
void |
calculateCurve(int segments)
Calculates and prints the specified number of Bezier points
|
public BezierFunction(org.apache.commons.math3.geometry.euclidean.threed.Vector3D p0, org.apache.commons.math3.geometry.euclidean.threed.Vector3D p1, org.apache.commons.math3.geometry.euclidean.threed.Vector3D p2, org.apache.commons.math3.geometry.euclidean.threed.Vector3D p3)
p0
- start point of the curvep1
- point defining the tangent at the start pointp2
- point defining the tangent at the end pointp3
- end point of the curvepublic org.apache.commons.math3.geometry.euclidean.threed.Vector3D calculateBezierPoint(float t)
t
- the interpolation parameter (0..1)public void calculateCurve(int segments)
segments
- the number of points to calculate