Skip to content

Commit

Permalink
fix ghost texture problem (issue #8) in load_obj
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroharu-kato committed Sep 20, 2018
1 parent 7b569f3 commit 310d8b5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions neural_renderer/load_obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,13 @@ def load_textures(filename_obj, filename_mtl, texture_size):
float dim0 = ((i / (ts * ts)) % ts) / (ts - 1.) ;
float dim1 = ((i / ts) % ts) / (ts - 1.);
float dim2 = (i % ts) / (ts - 1.);
if (1 < dim0 + dim1 + dim2) {
float sum = dim0 + dim1 + dim2;
dim0 /= sum;
dim1 /= sum;
dim2 /= sum;
}
// sum(dim[k]) -> 1
float sum = dim0 + dim1 + dim2;
dim0 /= sum;
dim1 /= sum;
dim2 /= sum;
const float* face = &faces[fn * 3 * 2];
float* texture = &textures[i * 3];
if (is_update[fn] == 0) return;
Expand Down

0 comments on commit 310d8b5

Please sign in to comment.