From 8393840e55baf10b18cdb1f04ca1620f8a23bdd6 Mon Sep 17 00:00:00 2001 From: Lucas Rassilan Vilanova Date: Sun, 19 May 2019 19:48:08 -0300 Subject: [PATCH] Bug fix. Using comma instead of dot in Convert.ToSingle --- .../Core/SharpGL.Serialization/Wavefront/ObjFileFormat.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/SharpGL/Core/SharpGL.Serialization/Wavefront/ObjFileFormat.cs b/source/SharpGL/Core/SharpGL.Serialization/Wavefront/ObjFileFormat.cs index 740c8f6c..bf952b03 100644 --- a/source/SharpGL/Core/SharpGL.Serialization/Wavefront/ObjFileFormat.cs +++ b/source/SharpGL/Core/SharpGL.Serialization/Wavefront/ObjFileFormat.cs @@ -101,9 +101,10 @@ private void LoadMaterials(string path, Scene scene) mtl.Diffuse = ReadMaterialColor(line, alpha); else if (line.StartsWith("Ks")) mtl.Specular = ReadMaterialColor(line, alpha); - else if (line.StartsWith("Ns")) + else if (line.StartsWith("Ns")) { + line = line.Replace(".", ","); mtl.Shininess = Convert.ToSingle(ReadMaterialValue(line)); - else if (line.StartsWith("map_Ka") || + } else if (line.StartsWith("map_Ka") || line.StartsWith("map_Kd") || line.StartsWith("map_Ks")) { @@ -136,6 +137,7 @@ private void LoadMaterials(string path, Scene scene) } else if (line.StartsWith("d") || line.StartsWith("Tr")) { + line = line.Replace(".", ","); alpha = Convert.ToSingle(ReadMaterialValue(line)); SetAlphaForMaterial(mtl, alpha); }