Simple courbe de bezier

image

Outils de visualisation fait par Freya Holmèr

Vector3 getBezierPoint(float t){
				//getPos return point transform position
        Vector3 p0 = getPos(0);
        Vector3 p1 = getPos(1);
        Vector3 p2 = getPos(2);
        Vector3 p3 = getPos(3);

        Vector3 a = Vector3.Lerp(p0, p1, t);
        Vector3 b = Vector3.Lerp(p1, p2, t);
        Vector3 c = Vector3.Lerp(p2, p3, t);

        Vector3 d = Vector3.Lerp(a, b, t);
        Vector3 e = Vector3.Lerp(b, c, t);

        return Vector3.Lerp(d, e, t);
}

Robin Moretti © 2020-Nov 19, 2021