From c552dbc58227ef423e168f057ec475e1f7ffbded Mon Sep 17 00:00:00 2001 From: Syoyo Fujita Date: Thu, 6 Sep 2012 00:19:38 +0900 Subject: [PATCH] Fix texcoord array indexing. --- tiny_obj_loader.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tiny_obj_loader.cc b/tiny_obj_loader.cc index ac93e3d..217df8a 100644 --- a/tiny_obj_loader.cc +++ b/tiny_obj_loader.cc @@ -165,9 +165,8 @@ updateVertex( } if (i.vt_idx >= 0) { - texcoords.push_back(in_texcoords[3*i.vt_idx+0]); - texcoords.push_back(in_texcoords[3*i.vt_idx+1]); - texcoords.push_back(in_texcoords[3*i.vt_idx+2]); + texcoords.push_back(in_texcoords[2*i.vt_idx+0]); + texcoords.push_back(in_texcoords[2*i.vt_idx+1]); } unsigned int idx = positions.size() / 3 - 1;