Эх сурвалжийг харах

fix matrix math in AxesFromMatrix

how did I go so long through life without knowing that a matrix is just a bunch of
basis vectors defining a space?
Joseph Brandenburg 6 сар өмнө
parent
commit
a323ac8f45
1 өөрчлөгдсөн 4 нэмэгдсэн , 4 устгасан
  1. 4 4
      misc_nodes.py

+ 4 - 4
misc_nodes.py

@@ -1470,10 +1470,10 @@ class UtilityAxesFromMatrix(MantisNode):
     def bPrepare(self, bContext = None,):
         from mathutils import Vector
         if matrix := self.evaluate_input("Matrix"):
-            matrix= matrix.copy().to_3x3()
-            self.parameters['X Axis'] = matrix @ Vector((1,0,0))
-            self.parameters['Y Axis'] = matrix @ Vector((0,1,0))
-            self.parameters['Z Axis'] = matrix @ Vector((0,0,1))
+            matrix= matrix.copy().to_3x3(); matrix.transpose()
+            self.parameters['X Axis'] = matrix[0]
+            self.parameters['Y Axis'] = matrix[1]
+            self.parameters['Z Axis'] = matrix[2]
         self.prepared = True; self.executed = True