Get the new relative position of an object that draws to a to jit.gl.node


    Feb 16 2020 | 5:40 pm
    hi, let say you create a simple gridshape. You tell this gridshape to draw to a jit.gl.node. Now you change position of this node in the 3d space. Is there a way to retrieve easaly the new relative position of that gridshape, therefore without to make a calculation of the new coordinates
    (i mean is there an argument or an already packaged feature that does it ?)
    In short this is what i want to achieve :
    let say i have 3 gridshape spheres. - At first they draw to jit.world. I can retrieve coordinates in the world context. - Now i d like to group these spheres so i can apply transformation to a groupe of objects, and i believe the best way is to create a gl.node (call "group1), and tell these spheres to draw to this node. - Now i change position, or rotate "group1" - i would like to be able to retrieve the new position of each of these spheres in the world context. Any idea of the best way to do this? example patch :
    thx!

    • Feb 17 2020 | 6:34 pm
    • Feb 17 2020 | 11:30 pm
      yep you need to use jit.anim.node. simply "bind" a jit.anim.node to the jit.gl object you'd like to query (either via patchcord from anim.node to jit.gl object, or via jit.gl @anim attribute set to the name of the anim.node object)
    • Feb 18 2020 | 3:38 pm
      excellent both! thx! i was confusing again between gl.node and anim.node ;)
      it is tricky a bit :) so it's better not bind to any jit.gl.node and start to move this node (as a group) if you want to be able to retrieve the position of initial gl object. good to know definitely
    • Feb 18 2020 | 4:00 pm
      ok just tested it. its not exactly what i want to do. I d like to gather object in a group (like a gl.node) and be able to retrieve position of each the initial objects if you move the node itself (as a group).
      any idea?
    • Feb 18 2020 | 7:04 pm
      https://cycling74.com/forums/jit-anim-node-hierarchy
    • Feb 18 2020 | 8:49 pm
      ok thx! It was really not obvious for me because you have to think an whole hierarchy based on anim.node and use that getworldpos on a lower anim.node that represents the intial position of the mesh or gridshape. got it now :) - i thought that jit.gl.node would have been the straight forward and ideal object to manage this.
      a simple summary patch :
    • Feb 19 2020 | 4:36 pm
      if you prefer to use jit.gl.node then go for it. the behavior in this case is identical: