def getPointOnHull( hullPoints,t, totalLength ):
lh = len(hullPoints)
for j in range(lh+1):
sideLength = distance.euclidean(hullPoints[j%lh],hullPoints[(j+1)%lh])
t_sub = sideLength / totalLength;
if t > t_sub:
t-= t_sub;
else :
return lerp(hullPoints[j%lh],hullPoints[(j+1)%lh], t / t_sub );
评论列表
文章目录