0
下面是从“多边形网格处理”的例子的代码段:计算一个三角形的面积openmesh
for (v_it=mesh_.vertices_begin(); v_it!=v_end; ++v_it) {
area = 0.0;
for (vf_it=mesh_.vf_iter(v_it); vf_it; ++vf_it)
{
fv_it = mesh_.fv_iter(vf_it);
const Mesh::Point& P = mesh_.point(fv_it); ++fv_it;
const Mesh::Point& Q = mesh_.point(fv_it); ++fv_it;
const Mesh::Point& R = mesh_.point(fv_it);
area += ((Q-P)%(R-P)).norm() * 0.5f * 0.3333f; // norm: compute euclidean norm, return Scalar
}
weight(v_it) = (fabs(area)>FLT_MIN ? 1.0/(2.0 * area) : 0.0);
}
为什么0.3333f在端相乘?
非常感谢你,你的回答对我很好。 –