jit.gl.handle & anim.gl.node : correctly orient child axes relative to parent

Jan 30, 2012 at 7:56pm

jit.gl.handle & anim.gl.node : correctly orient child axes relative to parent

Hi there, probably a question for Rob, but if anyone knows…

If I wanted to control an object with jit.gl.handle @hover 1 relative to a parent so that the orientation of the mouse aligned with the movement of the object on the screen, is there any way to do this?

For example, the position/rotation is controlling a parent and child. If the parent is turned 90′ then when clicking on the child, I would like to be able to reposition it using the 3D axes and mouse controls as a guide correctly oriented to the child.

Looking at the example provided below, try repositioning and reorienting the apple with the mouse.
The axis resides in a different location than the object being controlled by handle. Is anim.gl.node breaking jit.gl.handle somehow? Perhaps is the jit.gl.videoplane in the background breaking things?

When you try and rotate the model and re-position it using the mouse sometimes the model is moving at a 90′ angle to the mouse, which is really un-helpful. I’ve tried fiddling with a few different attributes but so far no luck.

Any pointers appreciated.

– Pasted Max Patch, click to expand. –
#61539
Jan 30, 2012 at 9:07pm

Oops, I mean jit.anim.node. bah…

#222094
Jan 31, 2012 at 5:14pm

the problem is backwards compatibility of the jit.gl.handle object.
in it’s original mode (non-autohandle), the handle has no knowledge of it’s connected object’s current transform state, it just blindly sends out position and rotation values based on it’s own current state.

however, position and rotation values for a child object (your anim.node), will cause different transformations then an object with no parent (the gl.handle).

the solution is to use gl.handle in autohandle mode (remove all connections from the gl.handle).

let me know if that does the trick for you.

#222095
Feb 1, 2012 at 5:13pm

Hi Rob, thanks for the reply! I was avoiding that before only because the auto_handle grabs hold of the background plane which breaks the augmentation, is there any way to make auto_handle ignore a particular object?

Should transform_reset 2 (which is applied to the plane) be overriding an auto_handle?

#222096
Feb 1, 2012 at 7:46pm

ahh yes, that is a problem. i was able to make it ignore the bg plane by setting it very far back along the z-axis (-50 or so).

i’ll look into adding smarter ways to ignore objects or ignoring transform_reset objects.

#222097
Feb 2, 2012 at 6:44pm

Would be most appreciated, thanks! Perhaps even something like the preset object, that a secondary outlet of jit.gl.handle connected to a specific OpenGL object ignores it when auto_handle is on?

#222098
Feb 22, 2013 at 3:20am

I know that this is somewhat old thread, but I would very much to have some more options in the jit.gl.handle object. For example, say you use a jit.gl.multiple to create a bunch of cubes and another jit.gl.multiple to create a bunch of spheres. It would be nice to be able to tell the handle to only grab spheres. Or better yet return the name of the object that was grabbed so that I treat a grabbed sphere differently than a grabbed cube.

Just my two cents.

#222099

You must be logged in to reply to this topic.