Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onClick Not working on Mesh #22

Open
Carlos-AvilesBuitron opened this issue Jul 26, 2022 · 9 comments
Open

onClick Not working on Mesh #22

Carlos-AvilesBuitron opened this issue Jul 26, 2022 · 9 comments

Comments

@Carlos-AvilesBuitron
Copy link

I am trying to fire an onClick function on a cube mesh that is a child of a Marker.
I get no errors but the function never fires on click.

Is this an issue or am I missing something?

Thanks

@j-era
Copy link
Contributor

j-era commented Jul 28, 2022

Alright, i see. The video element receives the clicks instead of the canvas objects. I'll fix that.

@j-era
Copy link
Contributor

j-era commented Jul 28, 2022

Fixed in v0.5.2 (see b971d7f)
@Carlos-AvilesBuitron Thanks for the hint!

@j-era j-era closed this as completed Jul 28, 2022
@Carlos-AvilesBuitron
Copy link
Author

Carlos-AvilesBuitron commented Jul 28, 2022 via email

@j-era
Copy link
Contributor

j-era commented Jul 28, 2022

Okay, think it's generally working https://codesandbox.io/s/determined-smoke-eo3jbn?file=/src/index.js ..but I recognize that some clicks are not handled, maybe some frames missing the tracking. Could you try the example, maybe it's working good enough for your usecase?

@j-era
Copy link
Contributor

j-era commented Jul 28, 2022

I see there's still a problem on mobile devices. Works well on desktop in my case. Reopening..

@j-era j-era reopened this Jul 28, 2022
@j-era
Copy link
Contributor

j-era commented Aug 2, 2022

There's a problem concerning portrait view. Ar.js generates a css margin-left which is taken into account in the r3f event system. I think the solution should be this PR

@Carlos-AvilesBuitron
Copy link
Author

Carlos-AvilesBuitron commented Aug 2, 2022

I see, thanks for keeping up with this. Looking forward to the merge.

@LucusWebsites
Copy link

I am running into this problem as well, mesh click handlers are not fired.
Any updates on this?

@j-era
Copy link
Contributor

j-era commented Jul 18, 2023

Should be fixed in 0.5.6 Missed updating projectionMatrixInverse

camera.projectionMatrixInverse.copy(arContext.arToolkitContext.getProjectionMatrix()).invert()

Updated example -> https://codesandbox.io/s/jolly-hodgkin-ssu33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants