Trying to get the pointer position on screen on mobile but I always get {x: -1, y: 1} for the this._context.input.getPointerPositionRC(0);
by user 103054507105067008
Trying to get the pointer position on screen on mobile but I always get {x: -1, y: 1} for the this._context.input.getPointerPositionRC(0);
by user 103054507105067008
“RC” is the pointer in threejs raycast coordinates (that is -1 and 1). Are you referring to AR usecase?
Yeah, going all the way back to basics going to get the onscreen touch position and use that to raycast into the scene at a ground plane then set the position by that
by user 103054507105067008
Use the events from the browser directly for now - “this.context.input.getPointer…” for AR is not 100% implemented.
Have a look at the browser touch events and subscribe to them via document.addEventListener:
they give you the screenspace coordinates which you can use for raycasting
Ah I see, wasted all day on this, might give up for now and try this again when I’m back in office next week. Didn’t realise it was going to be so tough to get the onscreen touches and manipulate an object in AR with them. For now I’ll tell the client they can use the moving around controller style with canGrab = true
for now at least
by user 103054507105067008
Sorry its what I meant earlier here Discord but maybe wasnt clear enough
Dw not your fault, I was happy to have the pointer events working as a baseline but from there I couldn’t get the pointer positions pulling in
by user 103054507105067008
Think I found what I need for the touch positions here
https://developer.mozilla.org/en-US/docs/Web/API/Touch/Touch#:~:text=any%20scroll%20offset.-,screenX%20Optional,-Defaults%20to%200
by user 103054507105067008