From dc74617820ad887f1a2b6b50289934ea71136fff Mon Sep 17 00:00:00 2001
From: biwa <foracc@d00m.info>
Date: Sun, 16 Jun 2019 00:03:37 +0200
Subject: [PATCH] - Fixed a problem with OBJ models being flipped

---
 Source/Core/GZBuilder/md3/ModelReader.cs | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Source/Core/GZBuilder/md3/ModelReader.cs b/Source/Core/GZBuilder/md3/ModelReader.cs
index 7e371a83c..afc6eebdf 100755
--- a/Source/Core/GZBuilder/md3/ModelReader.cs
+++ b/Source/Core/GZBuilder/md3/ModelReader.cs
@@ -1507,13 +1507,13 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
 			{
 				v.x = float.Parse(fields[0], CultureInfo.InvariantCulture);
 				v.z = float.Parse(fields[1], CultureInfo.InvariantCulture);
-				v.y = float.Parse(fields[2], CultureInfo.InvariantCulture);
+				v.y = -float.Parse(fields[2], CultureInfo.InvariantCulture);
 
 
 				// Prepare to fix rotation angle
-				float angleOfsetCos = (float)Math.Cos(Angle2D.PIHALF);
-				float angleOfsetSin = (float)Math.Sin(Angle2D.PIHALF);
-
+				float angleOfsetCos = (float)Math.Cos(-Angle2D.PIHALF);
+				float angleOfsetSin = (float)Math.Sin(-Angle2D.PIHALF);
+				
 				// Fix rotation angle
 				float rx = angleOfsetCos * v.x - angleOfsetSin * v.y;
 				float ry = angleOfsetSin * v.x + angleOfsetCos * v.y;
-- 
GitLab