从平面上的2D点转换为3D

时间:2013-02-19 18:15:44

标签: math graphics geometry

给定三角形表面上的2D点,三角形的每个角都是3D点,如何计算2D点的相应3D点?

1 个答案:

答案 0 :(得分:5)

要获取三角形上特定2D点的3D位置,请使用重心坐标来插入3D顶点的位置:

2D coordinates:  u,v such that 0 <= u,v <= 1  and  u+v <= 1
  ->  barycentric coordinates:  add t such that  t+u+v = 1  ->  t = 1-(u+v)

3D vertices:  V1, V2, and V3
  ->  result = u*V1 + v*V2 + t*V3