Forums > Jitter

jit.phys.picker touch

December 30, 2011 | 11:41 am

is it possible to have a little example about the touch message in jit.phys.picker ?

December 30, 2011 | 4:13 pm

sure thing.
let me know if anything is unclear.

— Pasted Max Patch, click to expand. —
December 31, 2011 | 8:57 am

ah yes all is clear;
thank you, this is a great feature !

September 13, 2012 | 2:43 pm

will it be possible to have the touch message into the object in the next update of max6?

September 13, 2012 | 4:17 pm

i’ve logged this as a feature request.

in the meantime, depending on your needs, you could use the phys objects simply for picking.
this will actually pick more accurately than the gl.picker, which uses axis-aligned bounding-boxes for picking.

September 14, 2012 | 2:51 pm

is it possible to use it with a object ?

September 14, 2012 | 9:44 pm

A last thing: as Mathieu Chamagne asked in another thread (, could the picker objects return the intersection position in the local coordinates of the object that is picked? May be an attribute could enable/disable this feature.


September 17, 2012 | 6:20 pm

hi JMC, i’ve registered your feature request.

September 17, 2012 | 7:29 pm

in the meantime, you can use jit.anim.node worldtolocal message to convert the world position to a local position relative to the rigid-body.
simply attach a rigid-body to a jit.anim.node, and query the phys.picker @position attribute whenever you click on an object.
this is the world-position of the of the click-point. send these values as arguments to the "worldtolocal" message, and you will get the local position values.

— Pasted Max Patch, click to expand. —
November 8, 2012 | 3:56 pm

i’m a little bit confused about how to click-and-drag on the z axis with phys.picker, it seems different than the option-click method in gl.handle – is there a way to do this?

November 9, 2012 | 10:02 pm

this is not currently a feature of phys.picker, but consider it a registered feature request.

March 19, 2013 | 9:09 pm

as of max 6.1, phys.picker will allow you to output the local and world pick coordinates, by enabling @output_positions.

additionally, you can now a selected object into and out of the camera view, by holding down the option key (similar to gl.handle).

check the Discussion section of the reference page for more info.

— Pasted Max Patch, click to expand. —
March 20, 2013 | 2:17 pm

for an ongoing project, i need to move gl objects in a scene with the mouse, without having gravity involved. I was thinking getting the mouse coordinates from the fullscreen window, calculate which object of the scene is relatively closer (and in front) of the cursor (i already have the position of each object relative to the camera), then updating coordinates of said object, using the screentoworld and worldtoscreen messages with (screentoworld would help translating the mouse on screen coordinates into something inside the gl scene, then worldtoscreen i’m not quite sure).
Then the mouse would be constrained into a plane relative to camera, i mean i have to decide of a 2D to 3D coordinates and was thinking to stay on a 2D plane parallel to the view, and moving the mouse would move the selected object along that plane – a little the same way that you can do with jit.phys.picker.

So my question now : would it be easier to do this using some objects ? Because i see that the would allow selection of objects the way i need, i don’t know though if it can work with each instance of a ; and also i don’t know if it would be good seeing that i don’t want realistic collisions/gravity.

March 20, 2013 | 5:52 pm

yes, this is a perfect use for jit.phys objects with dynamics disabled ( @dynamics 0).
meaning you are only interested in picking and collisions on a 3d scene. will only ever work with the axis-aligned bounding box, which in some cases is not precise enough. and it also doesn’t currently function with (although that may change in a future update).

you may also be interested in the raytest and screenraytest messages and raytest_mode attribute to

March 20, 2013 | 7:06 pm

Thanks, i wasn’t aware of…. when i wrote it, i was meaning jit.phys.picker ! though it might have been indeed cool (maybe not sufficient anyway ?) if gl.picker worked for displaying names of gl.multiple objects. But then, from what i understand, i’ll go the jit.phys way.

March 21, 2013 | 11:11 am

Hey Rob,
I triedf to pick with phys objects, but it doesn’t seem to want to pick anything when has @dynamics 0. When i turn it to 1, i can pick everything no problem. From what i could understand, i should be able to pick things with jit.phys.picker even if the world has @dynamic 0, right ? Or is it a max6.1+ only feature ?
Here’s the patch, in case i’m missing something :

— Pasted Max Patch, click to expand. —
March 21, 2013 | 5:03 pm

(this does not work with max6.1.1)

March 21, 2013 | 8:33 pm

I’ll be away for the next week. I’ll have to look at this when I get back. also check out the screenraytest message.

March 21, 2013 | 9:27 pm

hi vichug,
may be this can help you…


— Pasted Max Patch, click to expand. —
March 22, 2013 | 3:00 am

@Rob : ok, thanks a lot for your help
@matmat : it.. sort of… buut, i still would like to be able moving items along the 3 planes – that is, one "plane", the parallel plane to the current view, knowing that the current view will often change. But maybe you can "recenter" the axis of a phys world at any time ? if you could do it relatively to the current view, then you could disable one plane and that would be a solution… depending on how complicated it would be to "recenter" that phys world, it could also be like reinventing the wheel..
Anyway next i’ll try things with screenraytest. Thanks, again.

March 22, 2013 | 9:22 am

"@remove_plane 0" on and you to find your 3 axes…

March 22, 2013 | 1:54 pm

@matmat : … that’s a magic i have yet to understand… wonderful.

October 18, 2015 | 4:59 am

Hi Rob, I found this thread while researching a way to add picking functions to a, using VR hands I’v created via jit.phys.multiple (with your help on the other post)
I would love to implement a similar function like the jit.phys.picker e.g. grabbing and dropping an object in the world using my VR hands ..
I have managed to extract pinch-strength and palm-strength from the hands..i was thinking to use those values to activate a picking feature.. but i am wondering what you think would be the best way/object to use…?

Thank you Rob


October 19, 2015 | 9:19 am

use the phys.picker "touch" message as demonstrated in the patch i posted at the top of the thread.

October 19, 2015 | 4:00 pm

thank you Rob

October 24, 2015 | 4:57 am

Hi Rob, thank you for the reply on this. I have implemented the patch into my world but I am having few problems.
I have also checked the other posts on here.. but still cant really work out a solution.

Using the pictslider object to test I noticed it performers better with high values ( 1000 X 1000 ). If i use the 24 24 – world scale values, the touch-contact is not sufficient to move the cube in your example.
Also once the cube is dropped (touch down), I cannot touch it again. Instead I need to reset the cube position to 0 0 0 (via the r key ), activate the touch and then works. My ideal scenario would be to use the pinch values to activate the touch, and the palm position values instead of the pictslider object.
I am using Graham Wakefield’s Oculus object to be able to run my Oculus world and the rest.

I have attached a zip file with both my testing patch and Graham Wakefield’s Oculus object.

Please could you have a look, I am sure I am doing something wrong..and I would love to know how what exactly.

Thank you so much Rob,



October 29, 2015 | 3:46 am

Hi Rob,
I hope you are well. I just found this post re:jit.phys.picker, you were reporting a fault on max 7

Is this still broken, I am trying to implement a picking feature into my world with the leap.. but no luck
Thank you

October 29, 2015 | 5:07 am

Rob is working!!! I am so sorry for all this.. i was missing a bang!
All good Rob,

Viewing 28 posts - 1 through 28 (of 28 total)

Forums > Jitter