davyzhang
(davyzhang)
January 17, 2012, 9:10am
1
I don’t know why this won’t work
>>> s
Matrix(((1.0, 0.0, 0.0, 0.0),
(0.0, 1.0, 0.0, 0.0),
(0.0, 0.0, 1.0, 0.0),
(0.0, 0.0, 1.0, 1.0)))
>>> mc
Matrix(((0.7071067690849304, 0.0, -0.7071067690849304),
(0.0, 1.0, 0.0),
(0.7071067690849304, 0.0, 0.7071067690849304)))
>>> s.rotate(mc)
Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
TypeError: Matrix.rotate(): must have 3x3 dimensions
if this won’t work, how can I rotate a matrix, I didn’t mean to change the rotation value, I mean change the whole matrix with translations
davyzhang
(davyzhang)
January 17, 2012, 9:20am
2
>>> s.rotate(Euler((0,math.radians(90),0),‘XYZ’))
Traceback (most recent call last):
File “<blender_console>”, line 1, in <module>
TypeError: Matrix.rotate(): must have 3x3 dimensions
this won’t work too
davyzhang
(davyzhang)
January 17, 2012, 9:26am
3
>>> s[3].rotate(Euler((0,math.radians(90),0),‘XYZ’))
>>> s[3]
Vector((1.0, 0.0, -4.371138828673793e-08, 1.0))
this worked
PKHG
(PKHG)
January 17, 2012, 9:32am
4
s must be 3x3
eventually make it later again 4x4 (after rotation)
I think a rotation as matrix is ‘always’ a 3x3 matrix,
because rotations form a group (mathematics) with matrix multiplication as group operation
davyzhang
(davyzhang)
January 17, 2012, 10:05am
5
thanks for the explaination. I’ve been mislead by actionscript’s matrix.roate, in which allow a rotate using matrix4x4. I now guess it’s a shortcut for two steps