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

Use window for pointerevents #581

Open
4 tasks done
acvigue opened this issue Mar 7, 2024 · 2 comments · May be fixed by #583
Open
4 tasks done

Use window for pointerevents #581

acvigue opened this issue Mar 7, 2024 · 2 comments · May be fixed by #583
Labels
feature p2-to-be-discussed Enhancement under consideration (priority)

Comments

@acvigue
Copy link

acvigue commented Mar 7, 2024

Description

I have a TresCanvas with a lower z-index that is under the main content on my site. I got around this in native Three by using events based on window pointer events. I don't see a way to do this in Tres.

Suggested solution

Add a prop to TresCanvas like window-size (window-pointer?) to use window pointer events instead of attaching events to the canvas itself

Alternative

No response

Additional context

No response

Validations

@andretchen0
Copy link
Contributor

andretchen0 commented Mar 7, 2024

Hey @acvigue . Thanks for the feature request.

Maybe someone else can help in the meantime, but this sounds like it might fit in well with what I've been working on for v4 or after, depending on what the team thinks.

I'll add this to my personal to-do list, anyway.

To get a better idea of the requirements, would it be possible to post your workaround below? Even a bit of pseudocode would be fine. Or if you pulled it from a Three.js example, a link would be great!

@acvigue
Copy link
Author

acvigue commented Mar 8, 2024

Hi! Thanks. Yeah, I'm using nuxt 3 with native threejs and just use window.createeventlistener("pointermove" / "pointerenter" / "pointerleave") instead of tying the events directly to the canvas element.

Edit: Still using same raycaster logic and all but am just listening to events from the window instead of element if that makes more sense

@alvarosabu alvarosabu added feature p2-to-be-discussed Enhancement under consideration (priority) and removed enhancement labels Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature p2-to-be-discussed Enhancement under consideration (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants