/// <summary> /// Extract a face vertex. /// </summary> /// <returns>The face vertex.</returns> /// <param name="vertexStr">The vertex string.</param> ObjFaceVertex ExtractFaceVertex(string vertexStr) { var vertices = ReadVertexGroup(vertexStr); var face = new ObjFaceVertex { VertexIndex = 0, TextureIndex = 0, NormalIndex = 0 }; face.VertexIndex = ParseInt(vertices [0]); if (vertices.Length > 1) { face.TextureIndex = ParseInt(vertices [1]); } if (vertices.Length > 2) { face.NormalIndex = ParseInt(vertices [2]); } return(face); }
/// <summary> /// Extract a face vertex. /// </summary> /// <returns>The face vertex.</returns> /// <param name="vertexStr">The vertex string.</param> ObjFaceVertex ExtractFaceVertex(string vertexStr) { var vertices = ReadVertexGroup (vertexStr); var face = new ObjFaceVertex { VertexIndex = 0, TextureIndex = 0, NormalIndex = 0 }; face.VertexIndex = ParseInt (vertices [0]); if (vertices.Length > 1) face.TextureIndex = ParseInt (vertices [1]); if (vertices.Length > 2) face.NormalIndex = ParseInt (vertices [2]); return face; }