Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix. Using comma instead of dot in Convert.ToSingle #158

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
{
Expand Down Expand Up @@ -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);
}
Expand Down