berechnen Hier ist ein Ausschnitt aus „Polygon mesh Prozess“ Beispiel:die Fläche eines Dreiecks in 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);
}
warum 0.3333f am Ende multipliziert wird?
Vielen Dank, Ihre Antwort ist nett zu mir. –