You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
749 B
33 lines
749 B
#include <igl/opengl/glfw/Viewer.h>
|
|
#include <Eigen/Eigen>
|
|
int main(int argc, char *argv[])
|
|
{
|
|
// Load a 3D mesh
|
|
Eigen::MatrixXd V;
|
|
Eigen::MatrixXi F;
|
|
igl::read_triangle_mesh("mesh.obj", V, F);
|
|
|
|
// Create a viewer
|
|
igl::opengl::glfw::Viewer viewer;
|
|
|
|
// Add the mesh to the viewer
|
|
viewer.data().set_mesh(V, F);
|
|
|
|
// Create coordinate axes
|
|
Eigen::MatrixXd P(6,3);
|
|
P << 0, 0, 0,
|
|
1, 0, 0,
|
|
0, 1, 0,
|
|
0, 0, 1;
|
|
Eigen::MatrixXi E(3,2);
|
|
E << 0, 1,
|
|
0, 2,
|
|
0, 3;
|
|
|
|
|
|
// viewer.data().add_edges(P.row(E.col(0)), P.row(E.col(1)), Eigen::RowVector3d(1,0,0));
|
|
|
|
// Launch the viewer
|
|
viewer.launch();
|
|
return 0;
|
|
}
|
|
|