Forums > Jitter

How do you rotate jit.gl.multiple objects globally

July 8, 2013 | 2:18 pm

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.

Attached is a simplified patch which illustrates my problem

<code>

– Pasted Max Patch, click to expand. –

</code>


July 9, 2013 | 8:39 am

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


July 9, 2013 | 11:30 am

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…

Thanks for knocking my brain into gear!

<code>

– Pasted Max Patch, click to expand. –

</code>


Viewing 3 posts - 1 through 3 (of 3 total)