[Closed] matrix3 values
hello,
How can I change the value of the matrix rows.
for example :
$.transform return matrix3 [a,b,c] , [d,e,f] , [g,h,i] , [j,k,l]
that become
matrix3 [-a,b,c] , [-d,e,f] , [-g,h,i] , [-j,k,l]
thank you
Arno
Hi Arno,
from MaxScript Reference, under “Matrix3 Values”:
When working with object transformation matrix3 values, the rows and their sub-elements cannot be modified directly. To change a row or an element of the row, assign the matrix3 value to a user variable first, modify the matrix3 rows by assigning to the variable and then assign the variable back to the .transform property of the original object.
To do what you need, I’d go with this:
tm = $.transform
tmNew = (Matrix3 [-tm[1][1], tm[1][2], tm[1][3]] \
[-tm[2][1], tm[2][2], tm[2][3]] \
[-tm[3][1], tm[3][2], tm[3][3]] \
[-tm[4][1], tm[4][2], tm[4][3]] )
$.transform = tmNew
- Enrico
you can also do this:
a = matrix3 [1,2,3] [4,5,6] [7,8,9] [1,1,1]
b = matrix3 [-1,0,0] [0,1,0] [0,0,1] [0,0,0]
c = a * b
thanks a lot,
I will use this to match the transform of an world mirrored object.
Arno
arno3d.blogspot.com