我有以下函数可以将与三角形在同一平面上的点转换为重心点。//p0,p1andp2andthepointsthatmakeupthistriangleVector3dTri::barycentric(Vector3dp){doubletriArea=(p1-p0).cross(p2-p0).norm()*0.5;doubleu=((p1-p).cross(p2-p).norm()*0.5)/triArea;doublev=((p0-p).cross(p2-p).norm()*0.5)/triArea;doublew=((p0-p).cross(p1-p).norm()*0.5)/triA