This commit is contained in:
2020-01-03 15:09:55 +01:00
parent a60bb85aa7
commit 68f034ab8a

View File

@@ -301,9 +301,9 @@ Namespace ObjModule
Case line.ToLower.StartsWith("kd ") Case line.ToLower.StartsWith("kd ")
Dim splitColor() As String = line.Substring(3).Split(" "c) Dim splitColor() As String = line.Substring(3).Split(" "c)
Dim col As Color = Color.FromArgb( Dim col As Color = Color.FromArgb(
Convert.ToSingle(Math.Round(CInt(splitColor(0)))), Convert.ToSingle(Math.Round(255 * splitColor(0))),
Convert.ToSingle(Math.Round(CInt(splitColor(1)))), Convert.ToSingle(Math.Round(255 * splitColor(1))),
Convert.ToSingle(Math.Round(CInt(splitColor(2))))) Convert.ToSingle(Math.Round(255 * splitColor(2))))
curMat.Color = col curMat.Color = col
Case line.ToLower.StartsWith("d ") Case line.ToLower.StartsWith("d ")
@@ -365,7 +365,7 @@ Namespace ObjModule
sw.WriteLine($"newmtl {name}") sw.WriteLine($"newmtl {name}")
If mat.Color IsNot Nothing Then If mat.Color IsNot Nothing Then
sw.WriteLine($"kd {mat.Color.Value.R.ToString.Replace(",", ".")} {mat.Color.Value.G.ToString.Replace(",", ".")} {mat.Color.Value.B.ToString.Replace(",", ".")}") sw.WriteLine($"kd {(mat.Color.Value.R / 255).ToString.Replace(",", ".")} {(mat.Color.Value.G / 255).ToString.Replace(",", ".")} {(mat.Color.Value.B / 255).ToString.Replace(",", ".")}")
End If End If
If mat.Opacity IsNot Nothing Then If mat.Opacity IsNot Nothing Then