- Fixed a problem with OBJ models being flipped

This commit is contained in:
biwa 2019-06-16 00:03:37 +02:00
parent 97d4fdd78a
commit dc74617820

View file

@ -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;