小编dan*_*ipf的帖子

细分Bezier曲线

我想实现我可以细分具有给定距离的贝塞尔曲线.现在它可以工作,如果贝塞尔是一条直线,但如果我改变一个控制点(B&C),使贝塞尔得到弯曲,计算点之间的差距就不再像给定的距离!

我通过网络浏览,但没有遇到类似的问题.

float t = Distance between subdividedParts / bezier length;

//A,B,C,D = ControllPoints of Bezier

GetPoint(A,B,C,D,t);
Run Code Online (Sandbox Code Playgroud)
//GetPoint equation:
public static Vector3 GetPoint (Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, float t) {
         t = Mathf.Clamp01(t);
         float OneMinusT = 1f - t;
         return
             OneMinusT * OneMinusT * OneMinusT * p0 +
             3f * OneMinusT * OneMinusT * t * p1 +
             3f * OneMinusT * t * t * p2 +
             t * t * t * p3;
     }
Run Code Online (Sandbox Code Playgroud)

直接bezier 弯曲的bezier bezier explenation

c# bezier curve division unity-game-engine

5
推荐指数
1
解决办法
198
查看次数

标签 统计

bezier ×1

c# ×1

curve ×1

division ×1

unity-game-engine ×1