Skip to content

Commit

Permalink
Fixed bug in obj loading when no textures are present
Browse files Browse the repository at this point in the history
  • Loading branch information
HeDo88TH committed May 25, 2022
1 parent 8c5c2b1 commit f35043d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Obj2Tiles.Library/Geometry/MeshUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ public static IMesh LoadMesh(string fileName)
var second = segs[2].Split('/');
var third = segs[3].Split('/');

var hasTexture = first[1].Length > 0 && second[1].Length > 0 && third[1].Length > 0;
var hasTexture = first.Length > 1 && first[1].Length > 0 && second.Length > 1 &&
second[1].Length > 0 && third.Length > 1 && third[1].Length > 0;

// We ignore this
// var hasNormals = vertexIndices[0][2] != null && vertexIndices[1][2] != null && vertexIndices[2][2] != null;
Expand Down

0 comments on commit f35043d

Please sign in to comment.