main.cpp 784 B

1234567891011121314151617181920212223
  1. #include "tutorial_shared_path.h"
  2. #include <igl/opengl/glfw/Viewer.h>
  3. #include <string>
  4. int main(int argc, char * argv[])
  5. {
  6. igl::opengl::glfw::Viewer v;
  7. for(const auto & name :
  8. {"cube.obj","sphere.obj","xcylinder.obj","ycylinder.obj","zcylinder.obj"})
  9. {
  10. v.load_mesh_from_file(std::string(TUTORIAL_SHARED_PATH) + "/" + name);
  11. }
  12. v.selected_data_index = 0;
  13. v.selected_data().set_colors(Eigen::RowVector3d(0.8,0.47,0.22));
  14. v.selected_data_index = 1;
  15. v.selected_data().set_colors(Eigen::RowVector3d(0.6,0.01,0.11));
  16. v.selected_data_index = 2;
  17. v.selected_data().set_colors(Eigen::RowVector3d(0.37,0.06,0.25));
  18. v.selected_data_index = 3;
  19. v.selected_data().set_colors(Eigen::RowVector3d(1,1,1));
  20. v.launch();
  21. return EXIT_SUCCESS;
  22. }