medusa.georgios.color_factory
Class CubicBezierCurve3f
- java.lang.Object
-
- medusa.georgios.color_factory.AbstractCurve3f
-
- medusa.georgios.color_factory.CubicBezierCurve3f
-
public final class CubicBezierCurve3f extends AbstractCurve3f
Provides an interpolation mechanism using cubic bezier segments to compose a curve. The appropriate segments are not pre-calculated. Instead they are computed on demand. Simply plug in a vector of coordinates usingsetCoordinate( Vector coordinates ). The curve is parameterized from 0 to 1. Provide additional parameters to control the curve. The membersprePointandpostPointare used for computing C1 continuous transitions between neighboring segments. You can explicitly set the initial and final tangent to force the curves tangent at parameter 0 and 1. Note that the tangent setting is dominant over the pre- and post-point setting.
-
-
Field Summary
Fields Modifier and Type Field and Description Tuple3ffinalTangentPlug-in for a the final tangentTuple3finitialTangentPlug-in for a the initial tangentTuple3fpostPointPlug-in for a point that is appropriate for extrapolationTuple3fprePointPlug-in for a point that is appropriate for extrapolationfloattangentScaleScale factor for the tangents computed for C1 continuity
-
Constructor Summary
Constructors Constructor and Description CubicBezierCurve3f()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Point3fcomputePoint(float parameter)Computes the point coordinate of the curve at parameterparameter.Vector3fcomputeTangent(float parameter)Computes the tangent of the curve at parameterparameter.voidsetTangents(java.util.ArrayList tangents)Sets the tangents vector of the cubic bezier curve.-
Methods inherited from class medusa.georgios.color_factory.AbstractCurve3f
getCoordinates, isUseDefaultDomain, mapCurveParameterToSegmentIndex, mapCurveParameterToSegmentParamter, setCoordinates, setDomain, setUseDefaultDomain
-
-
-
-
Field Detail
-
prePoint
public Tuple3f prePoint
Plug-in for a point that is appropriate for extrapolation
-
postPoint
public Tuple3f postPoint
Plug-in for a point that is appropriate for extrapolation
-
initialTangent
public Tuple3f initialTangent
Plug-in for a the initial tangent
-
finalTangent
public Tuple3f finalTangent
Plug-in for a the final tangent
-
tangentScale
public float tangentScale
Scale factor for the tangents computed for C1 continuity
-
-
Method Detail
-
setTangents
public void setTangents(java.util.ArrayList tangents)
Sets the tangents vector of the cubic bezier curve. Note that the number of tangents must be at least the same as the numbers of points provided to the curve.- Parameters:
tangents- The newtangentsvalue.
-
computeTangent
public final Vector3f computeTangent(float parameter)
Computes the tangent of the curve at parameterparameter.- Specified by:
computeTangentin classAbstractCurve3f- Parameters:
parameter- for the computation.- Returns:
Vector3f- the computed tangent.
-
computePoint
public final Point3f computePoint(float parameter)
Computes the point coordinate of the curve at parameterparameter.- Specified by:
computePointin classAbstractCurve3f- Parameters:
parameter- for the computation.- Returns:
Point3f- the computed coordinate.
-
-
DMelt 3.0 © DataMelt by jWork.ORG