Cosmetic updates.

This commit is contained in:
Syoyo Fujita
2016-01-29 19:55:04 +09:00
parent b3eed44b3e
commit 968ad8248e
2 changed files with 6 additions and 4 deletions

View File

@@ -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],

View File

@@ -84,8 +84,8 @@ typedef struct
std::vector<float> normals;
std::vector<float> texcoords;
std::vector<unsigned int> indices;
std::vector<unsigned char> num_vertices; // up to 255 faces
std::vector<int> material_ids; // per-mesh material ID
std::vector<unsigned char> num_vertices; // The number of vertices per face. Up to 255.
std::vector<int> material_ids; // per-face material ID
std::vector<tag_t> tags; // SubD tag
} mesh_t;