How do you rotate jit.gl.multiple objects globally

zcwaa22's icon

Hi,

I have a patch in which a jit.gl.multiple loads around 500 gridshape objects each with random rotations. Once the objects are loaded up I want to rotate them all globally around their individual origins. So sending [angle,1,0,0] would rotate them around the global x axis.

Ive tried sending rotate messages to the gridshape but this rotates the whole spread of objects around 0,0,0.

Also had a look at jit.gl.node but I couldn't make it work that way.

I think I need to do some magical maths using the object's initial random rotations and the global rotations I want to apply, I've searched the forum and the web but can't get a grasp on the maths I need to use, so hope someone can help.

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

Attached is a simplified patch which illustrates my problem

Rob Ramirez's icon

does simply rotating the jit.gl.multiple (either with its @rotate or @rotatexyz attributes) not give what you want?

zcwaa22's icon

Hi Rob,

No unfortunately sending rotate to the jit.gl.multiple rotates all the objects around the multiple's centerpoint/origin.

Your post made me re-examine what I was after and I think what's below is working, although the objects aren't rotating around the specified X/Y/Z axes they do seem to be rotating globally rather than locally...

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

Thanks for knocking my brain into gear!