Notifications
Clear all

[Closed] How to get model's 3×3 rotation matrix ?

Hi guys,

I’m very new to maxscript and i’m writing an (xml) exporter as a first learning project. It’s just basicly converting the object properties into plain text format. The specs of a file format says, that the object rotation is defined by 3×3 rotation matrix in row major format. The matrix should be orthogonal. In example the null rotation is defined like this: 1 0 0 0 1 0 0 0 1

I’ve messed around all day today and i cant figure out the right way of doing this.

Heres what i’ve tested so far:

orthogonalize(obj.transform as matrix3)
obj.transform.rotation as matrix3
inverse obj.transform.rotation as matrix3
obj.rotation as matrix

Well… none of those are giving me the correct values. So i figure, that this maby is trickier than i initially assumed. Any help would be greatly appreciated !!

Thank you in advance!
Suvakas

3 Replies

Can’t access max now so can’t check, but if I remember correctly simple
obj.transform should return the matrix3 value (4×3 matrix, 4th row being the position).
Matrix rows are point3 vectors accessible with properties .row1 to .row4, and the vector components .x .y and .z.
In a sense matrix3 value does not yield any rotation data, merely the orientations of the axises of the coordinate system in which the object is built.
You can of course convert this data to the format you specified and rebuild the matrix from there, but you can’t do it directly.

$.transform.rotationpart

mark

Thank you guys.I got it working.
yep – just a simple obj.transform did it.
Thanks again.

suvakas