Jit.gl.node anchor/center of rotation point not moving when xyz position changed

Apr 8, 2013 at 9:12pm

Jit.gl.node anchor/center of rotation point not moving when xyz position changed

Hi
Ive been trying to figure this out for ages. Basically the center of rotation for a jit.gl.node object, which contains the 4 quarters that up a whole cube, is not moving when the position of the node is changed. Ive tried modifying the @anchor attribute but that just seems to knock things even further out of sync.

Hopefully someone can work this out…the patch is pretty self explanatory.

thanks

– Pasted Max Patch, click to expand. –
#67601
Apr 8, 2013 at 10:54pm

looks like you pasted the wrong patch, as there’s no gl.node.
maybe try again?

#243260
Apr 8, 2013 at 11:07pm

Ive just checked…its there you just have to scroll across to right

#243261
Apr 9, 2013 at 12:22am

why are you also sending the position values to the child gridshapes?
removing the “s cubecoords1″ gives me expected behavior.

you can position the gl.node, and the gridshapes will maintain there same relative position, allowing you to rotate the 4 objects around the gl.node origin.

if that doesn’t fix your problem, please give more info about what you think is wrong, including steps to reproduce.

#243262
Apr 9, 2013 at 10:43am

Sorry i probably didn’t explain it very well. Basically the cube is actually split into 4 quarters, if you hit the large bang on the right you’ll see them explode outwards and then return back to the cube. The “s cubecoords1″ is to control this animation. The node object (parent) is there so that the 4 quarters of the cube can be moved and supposedly rotated as a whole cube and then when you hit the bang the animation will occur in the correct place.

The problem:

When the position of the whole cube(node object) is set to 0. 0. 0. then using rotatexyz you can rotate around its centre however when the position coordinates are set differently the rotation anchor remains at 0. 0. 0. so the cube cant be rotated around its own centre. Ive tried changing the @anchor attributes however that only allows you to offset the cube from its centre, not move the centre to the cube.

#243263
Apr 9, 2013 at 6:37pm

again, you don’t need to send the position values to both the gl.node and the child gridshapes.

– Pasted Max Patch, click to expand. –
#243264
Apr 9, 2013 at 6:54pm

ahh sorry you’re right and that solves the problem.

I’ve spent so long trying to figure it out i got stuck looking at it the wrong way.

Thanks for taking the time to look at it.

#243265

You must be logged in to reply to this topic.