Files
igl/tutorial/100_FileIO/main.cpp
T
Daniele Panozzo 127893e2a5 added new OpenGL 4 Viewer based on glfw
added two examples for the libigl tutorial


Former-commit-id: f3cb5bb4ee
2014-06-15 18:02:23 +02:00

21 lines
487 B
C++
Executable File

#define IGL_HEADER_ONLY
#include <igl/readOFF.h>
#include <igl/writeOBJ.h>
#include <iostream>
Eigen::MatrixXd V;
Eigen::MatrixXi F;
int main(int argc, char *argv[])
{
// Load a mesh in OFF format
igl::readOFF("cube.off", V, F);
// Plot the vertices and faces matrices
std::cerr << "Vertices: " << std::endl << V << std::endl;
std::cerr << "Faces: " << std::endl << F << std::endl;
// Save the mesh in OBJ format
igl::writeOBJ("cube.obj",V,F);
}