Skip to content

Commit

Permalink
Reset transform (#1025)
Browse files Browse the repository at this point in the history
When rebuild the morph target from Delta values stored into Max, we do NOT need to apply Transformation while the extracted data are already in World Coordinate.
  • Loading branch information
pandaGaume committed Jan 22, 2022
1 parent 235ad02 commit 3f50c8f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions 3ds Max/Max2Babylon/Exporter/BabylonExporter.Mesh.cs
Original file line number Diff line number Diff line change
Expand Up @@ -669,10 +669,8 @@ private IEnumerable<IPoint3> ExtractMorphTargetPoints(BabylonAbstractMesh babylo
int j = str.IndexOf(']', i++);
var p3Str = str.Substring(i, j - i);
var xyz = p3Str.Split(',').Select(s => float.Parse(s, CultureInfo.InvariantCulture)).ToArray();
var p = Loader.Global.Point3.Create(xyz[0], xyz[1], xyz[2]);
p = offsetTM.PointTransform(p);
// we have to reverse y and z
p = Loader.Global.Point3.Create(p[0] * scaleFactorToMeters, p[2] * scaleFactorToMeters, p[1] * scaleFactorToMeters);
// conversion: Max to Directx(Babylon) (swap Y and Z).
var p = Loader.Global.Point3.Create(xyz[0] * scaleFactorToMeters, xyz[2] * scaleFactorToMeters, xyz[1] * scaleFactorToMeters);
yield return p;
i = str.IndexOf('[', j);
} while (i != -1);
Expand Down

0 comments on commit 3f50c8f

Please sign in to comment.