40 #include <Eigen/Eigen> 43 using namespace Eigen;
49 throw std::runtime_error(
"Vertex normals are not computed for input mesh. Call computeVertexNormals() before " 50 "passing as input to mesh_filter.");
52 mesh_label_ = mesh_label;
53 list_ = glGenLists(1);
54 glNewList(list_, GL_COMPILE);
55 glBegin(GL_TRIANGLES);
56 glColor4ubv((GLubyte*)&mesh_label_);
59 unsigned v1 = 3 * mesh.
triangles[3 * tIdx];
60 unsigned v2 = 3 * mesh.
triangles[3 * tIdx + 1];
61 unsigned v3 = 3 * mesh.
triangles[3 * tIdx + 2];
78 glDeleteLists(list_, 1);
83 glMatrixMode(GL_MODELVIEW);
85 if (!(transform.matrix().Flags & RowMajorBit))
86 glMultMatrixd(transform.matrix().data());
88 glMultTransposeMatrixd(transform.matrix().data());
void render(const Eigen::Affine3d &transform) const
renders the mesh in current OpenGL frame buffer (context)
unsigned int triangle_count
GLMesh(const shapes::Mesh &mesh, unsigned int mesh_label)
Constucts a GLMesh object for given mesh and label.