rotatexyz attribute incompatible with previous max versions?

Tarik's icon

Hi list,

This subject MUST have been discussed extensively but I can't seem to find the discussion.

When one adds a rotatexyz attribute to a jit.gl.gridshape for instance, the rotations applied to the shape are very different when one uses max 6.0.1 (or earlier), as opposed to when one uses one of the latest versions of max.

This example patch will show a vertically oriented cylinder in an older version of max, while it is horizontally oriented in a newer version. Where can i find info about this and how do i convert my older patches using rotatexyz in the old way to also work with newer versions of max?

thanks!

Max Patch
Copy patch and select New From Clipboard in Max.

tarik

Rob Ramirez's icon

hi tarik.
this is the result of changes in how gl objects handle transforms in max 6 vs max 5, and has to do the the order the euler rotations are applied. unfortunately, max 6 handles this differently than max 5. believe it or not, this is the first post i've seen catching this discrepancy, although is somewhat related to this post, which explains the details more:
https://cycling74.com/forums/request-jit-euler2quat-jit-quat2euler-_-attribute-for-order-of-rotation

the feature request for a rotation order attribute is still pending.

in the meantime, your best bet may be to do a find and replace using a text editor or command line on your relevant max patches.
the correct values to mimic the behavior you see in max 5 is "rotatexyz 90 -90 180"

apologies for the inconvenience.

Tarik's icon

Amazing! I'd think this change would significantly alter the behaviour of many many jitter patches and would have complaints flooding in.

Well, I figured some stuff out and I now went the route of writing my own rotatexyz to quaternion converter as a Java external, so I can apply the rotations in any order I'd like. Rotation used to be in the order XYZ and now is done in the order ZYX.

If you're interested, do let me know!

..and thanks

dtr's icon

I'd be interested in that!

artemis7's icon

I'd be interested as well.

Tarik's icon

Cool, I'll make it somewhat presentable to the public and available then... keep you posted

Rob Ramirez's icon

hi guys.
6.1.3 introduces a new attribute for jit.gl.render, called @rotate_order.
this will set the rotation order for all objects bound to that context.
hopefully this will alleviate some of the problems when porting from max 5.