[possible bug] touch message for jit.phys.picker with ortho camera

Spa's icon

It seems that the touch message got Y inverted when ortho=1 or 2 for the camera.

Directly picking in the window works correctly.
but sending the same coordinates with touch is Y inverted.

I know there's in OpenGL something about the inverted matrix transform with ortho view.
I suppose it's not considered with the touch message.

Spa's icon

Well after some experiments, it seems that touch messge is buggy also with a 'normal' camera.
The vertical position of a touch is offseted.
This offset becomes biggger the wider the camera angle. ???
Strangely, horizontal position does not seems affected.

Andro's icon

Check the forums for something like " world to screen "

Rob Ramirez's icon

hi spa, can you provide a simple patch demonstrating this?

Spa's icon

Here it is.
By the way, could we get 'output_positions' even if dynamics=0?
and for touch too?

I think i remenber that screenraytest has the same problem...

Phys_picker_touch_Bug.maxpat
Max Patch
Rob Ramirez's icon

yeah, i can see some issues here. thanks for the patch, i'll see what i can do to fix this.

Spa's icon

Thanks for looking at it.
It becomes a "big" problem when using nested compositions with jit.gl.node.
The offsets adds... particularly with rotation of ctx.
I'm develloping a multitouch app and it makes impossible to use jit.gl.node. :(
Do you imagine solving it soon, or should I just work around it?
Thanks