From 968ad8248e0ae2e5cf232e9a81e4ec4f0d124f97 Mon Sep 17 00:00:00 2001 From: Syoyo Fujita Date: Fri, 29 Jan 2016 19:55:04 +0900 Subject: [PATCH] Cosmetic updates. --- README.md | 6 ++++-- tiny_obj_loader.h | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1c0fc22..35cf100 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Tiny but poweful single file wavefront obj loader written in C++. No dependency What's new ---------- -* Jan 29, 2016 : Support n-polygon and OpenSubdiv crease tag! Thanks dboogert! +* Jan 29, 2016 : Support n-polygon(no triangulation) and OpenSubdiv crease tag! Thanks dboogert! * Nov 26, 2015 : Now single-header only!. * Nov 08, 2015 : Improved API. * Jun 23, 2015 : Various fixes and added more projects using tinyobjloader. Thanks many contributors! @@ -84,6 +84,8 @@ Licensed under 2 clause BSD. Usage ----- +TinyObjLoader triangulate input .obj by default. + #define TINYOBJLOADER_IMPLEMENTATION // define this in only *one* .cc #include "tiny_obj_loader.h" @@ -175,7 +177,7 @@ Reading .obj without triangulation. Use `num_vertices[i]` to iterate over faces( for (size_t n = 0; n < shapes[i].mesh.num_vertices.size(); n++) { int ngon = shapes[i].mesh.num_vertices[n]; for (size_t f = 0; f < ngon; f++) { - size_t v = shapes[i].mesh.indices[indexOffset + f]; + unsigend int v = shapes[i].mesh.indices[indexOffset + f]; printf(" face[%ld] v[%ld] = (%f, %f, %f)\n", n, shapes[i].mesh.positions[3*v+0], shapes[i].mesh.positions[3*v+1], diff --git a/tiny_obj_loader.h b/tiny_obj_loader.h index 1ad3f5c..9665d42 100644 --- a/tiny_obj_loader.h +++ b/tiny_obj_loader.h @@ -84,8 +84,8 @@ typedef struct std::vector normals; std::vector texcoords; std::vector indices; - std::vector num_vertices; // up to 255 faces - std::vector material_ids; // per-mesh material ID + std::vector num_vertices; // The number of vertices per face. Up to 255. + std::vector material_ids; // per-face material ID std::vector tags; // SubD tag } mesh_t;