Simple way to interpolate between points in 3D space to form a smooth surface

前端 未结 6 1529
礼貌的吻别
礼貌的吻别 2020-12-15 09:38

I\'m trying to come up with a simple and efficient way to create a smooth surface which intersects a number of given \"sample\" points.

For any X,Y point on the surf

6条回答
  •  离开以前
    2020-12-15 10:11

    If you want a simple linear interpolation of that point, then the Z value of the center point is just the mean of the 4 neighboring Z-values, given the distances are symmetric in both Y and X.

    If the distances are not symmetric, but the center point is always on the same X and Y lines, you can calculate both Y and X interpolations and the final value is the mean of those.

    So Zc would be: Zc=(Zx1+x*(Zx2-Zx1)/(x2-x1)+Zy1+y*(Zy2-Zy1)/(y2-y1))/2, where x and y are distances from x1 and y1.

提交回复
热议问题