Skip to content

How to open a mesh file?

Sk. Mohammadul Haque edited this page Apr 4, 2019 · 1 revision

Open a mesh file and display some information about it.

#include <meshlib.h>
#include <inttypes.h>

int main(int argc, char* argv[])
{
    MESH m;
    if(argc<2)
    {
        printf("input mesh filename not given\n");
    }
    else
    {
        m = mesh_load_file(argv[1]);
        printf("number of vertices: %" PRId64 "\n", m->num_vertices);
        printf("number of faces: %" PRId64 "\n", m->num_faces);
        mesh_free_mesh(m);
    }
    return 0;
}
Clone this wiki locally