so first i am generating the objects positions to fit the whole field of view, using tg(field of view)*depth for maximum x val. than i am converting the real radius and position of the spheres to that what we see from camera view and chech if mouse is over. i dont know how to explain it clearly, abu i am attaching some images, that will show, what i am meaning.
now everything works more or less ok, but my problem is that i want to animate the positions matrix first, and have the opportunity to grab the object and drag it to the other position, and i am stuck..
i hope, that images, and my patch will illustrate my thought clearly :)
ok, i would try something like the following patch.
the physics setup involves making the phys.world 2D by setting a value for remove_plane attribute and setting a @filterclass on the picker, and @filter on the phys.multiple to the picker's filterclass.
the trick is to get the matrix cell position from the instance index reported by phys.picker, and then using that to set the mass value of that instance to 1, so you can drag it.
hopefully this helps you get started with a solution using physics.
i have created prototype for illustrating the funcionality. can you tell me which way, is the best to get max performance? attached version is done using poly~ and it is slowing down when i am generating too much spheres..
Suppose I had many copies of two different phys objects rendered using this same trick. For example two 3x3 matrices each sent to a different jit.phys.multiple, jit.gl.multiple, and jit.gl.gridshape object . I would then have 9 spheres and 9 cubes in my phys world. Could I then use a picker (or perhaps two pickers?) to identify whether the object I click on is a cube or a sphere?