浏览代码

fix structure orientation translation-matrix

Alexander Rose 5 年之前
父节点
当前提交
2edb31e7ea
共有 1 个文件被更改,包括 2 次插入2 次删除
  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)