Tresjs / tres

Declarative ThreeJS using Vue Components

Home Page:https://tresjs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use window for pointerevents

acvigue opened this issue · comments

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

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!

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