Find a point on a "line" between two Vector3
http://forum.unity3d.com/threads/find-a-point-on-a-line-between-two-vector3.140700/
public Vector3 LerpByDistance(Vector3 A, Vector3 B, float x) { Vector3 P = x * Vector3.Normalize(B - A) + A; return P; }
Tips: x can more than the distance between A and B
Vector3 Lerp(Vector3 start, Vector3 end, float percent) { return (start + percent*(end - start)); }
时间: 2024-10-29 22:06:10