setting tangents of curve points for smooth curve

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By dearme

how to smooth out the curve programmatically?

I have been playing with methods of the curve SetPointLeftMode and SetPointRightMode but just setting the mode is not enough:

        for (int i = 0;i < curve.PointCount; i++)
        {
            curve.SetPointLeftMode(i, Curve.TangentMode.Free);
            curve.SetPointRightMode(i, Curve.TangentMode.Free);
        }

In addition tangent value must be set somehow with SetPointLeftTangent and SetPointRightTangent. So how do I find these values based on the “before” and “after” points position vectors?

latest you mean 4.1 RC1?

Moreus | 2023-03-20 12:55

@Moreus no I mean latest stable release 4.0 mono. Is there something interesting in 4.1. that would help me with this task?

dearme | 2023-03-20 13:37