Fix vertex_index creation.

This commit is contained in:
Syoyo Fujita
2016-05-15 19:18:21 +09:00
parent d392282f02
commit 54c28bd05f
3 changed files with 29 additions and 22 deletions

View File

@@ -194,6 +194,9 @@ bool LoadObjAndConvert(float bmin[3], float bmax[3], const char* filename)
assert(f0 >= 0);
assert(f1 >= 0);
assert(f2 >= 0);
assert(3*f0+2 < normals.size());
assert(3*f1+2 < normals.size());
assert(3*f2+2 < normals.size());
for (int k = 0; k < 3; k++) {
n[0][k] = normals[3*f0+k];
n[1][k] = normals[3*f1+k];