Browse Source

fix structure orientation translation-matrix

Alexander Rose 5 years ago
parent
commit
2edb31e7ea
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/mol-plugin/util/structure-orientation.ts

+ 2 - 2
src/mol-plugin/util/structure-orientation.ts

@@ -72,7 +72,7 @@ function buildMomentsAxes(state: MeshBuilder.State, data: OrientationData, props
     Vec3.toArray(Vec3.add(tmpAxesVec, origin, dirC), vertices, 12)
     Vec3.toArray(Vec3.sub(tmpAxesVec, origin, dirC), vertices, 15)
 
-    const matrix = Mat4.fromTranslation(Mat4(), Vec3.inverse(Vec3(), origin))
+    const matrix = Mat4.fromTranslation(Mat4(), Vec3.negate(Vec3(), origin))
 
     const cage = createCage(vertices, edges)
     const volume = Axes3D.volume(data.principalAxes.boxAxes)
@@ -115,7 +115,7 @@ function buildOrientedBox(state: MeshBuilder.State, data: OrientationData, props
     addCornerHelper(negDirA, dirB, dirC)
     addCornerHelper(negDirA, dirB, negDirC)
 
-    const matrix = Mat4.fromTranslation(Mat4(), Vec3.inverse(Vec3(), origin))
+    const matrix = Mat4.fromTranslation(Mat4(), Vec3.negate(Vec3(), origin))
 
     const cage = createCage(vertices, edges)
     const volume = Axes3D.volume(data.principalAxes.boxAxes)