I'm trying to just set the face color of a certain face and my code keeps throwing an error.
The line mesh.set_color(*f_it, clr);
is throwing an error (something about a property error). I've tried changing it to mesh.set_color(f_it.handle(), clr);
but that throws a dereferencing error.
Am I going about setting the color correctly?
typedef OpenMesh::TriMesh_ArrayKernelT<> myMesh;
myMesh * Mesh;
myMesh mesh;
void computeFaceNormals(myMesh mesh) {
OpenMesh::Vec3f pointA, pointB, pointC;
myMesh::VertexIter vlt, vBegin, vEnd;
myMesh::ConstFaceVertexIter cfvlt;
myMesh::Color clr;
for (myMesh::FaceIter f_it = mesh.faces_begin(); f_it != mesh.faces_end(); f_it++) {
cfvlt = mesh.cfv_iter(*f_it);
pointA = mesh.point(*cfvlt);
pointB = mesh.point((*cfvlt++));
pointC = mesh.point((*cfvlt++));
clr[0] = 0;
clr[1] = 1;
clr[2] = 0;
mesh.set_color(*f_it, clr);
}
}