how to grab an "object" in the vr (HTC Valve)?

sandroid's icon

Does anybody tried to grab a model or gridshape in Jitter/vr (HTC Valve) by using the valve controller? Could be something related to "picker" and position/command of the controller?

Mathieu Chamagne's icon

Rob Ramirez made this tool that should do the trick :
https://github.com/robtherich/jit.phys.3dpicker/releases

Graham Wakefield's icon

Do you want to pick with a laser pointer, or by grabbing with the hands?

For the former, something with a raycast from the controller would be needed. It could use physics (jit.phys.picker etc.), but you don't need to -- look at the "touch_ray" message of jit.gl.picker. Just needs a bit of math to figure out what the ray direction is for each controller.

For the latter, jit.phys.ghost locked to the controller position should work well.

sandroid's icon

Thanks Graham and Mathieu. I tried your suggestions and I had some success so far.
I am using the "Max_Worldmaking_Package-devel" help file as the starting point of my experiment. The idea is to stick to the object when touching it with the controller and also be able to hang it. So far I am able to attract the virtual object as a magnet, without hanging it from the ground (I´ve played with central-force, etc, with no successas can be seen i my patch). I also would like to have the information about collisions between the controller and the objects. I attached the patches I've been working (I attached the whole pacth cause I´ve made some changes in the names/contexts). The behaviour of the objects are inside the "worldPHYS" patch and the controller behavior is inside the "all-tracking-data" (sorry for my messy patching) . Any clues will be very welcome.

Max Patch
Copy patch and select New From Clipboard in Max.