Pointer Events 2023

What is the new way to handle mouse / pointer events in 2023 ?

  • 10 years ago (2013) we had Ray Tracing ( lots of programming to do simple things like drag )
  • Few years later we had THREE.Interaction ( now incompatible with Rev 158 )

How to handle mouse and touch events in 2023?

Raycasting is still the standard approach, combined with some custom code to handle dragging / pointer over / pointer out events (example.)

For react-three-fiber it’s a bit simpler - since it’s just the default react event callbacks.

1 Like

This is not the solution I am looking for , but thanks @mjurczyk

I’m specifically searching for a library to abstract away the manual coding and enable intuitive interactivity like THREE.Interaction did. Still not sure why this has not been integrated into THREE.js

react-three-fiber looks interesting but I don’t want to build on React.

There’s this but it looks like a completely different syntactical way of writing three which may or may not be worth going to the effort of learning / implementing if this lib is ever abandoned…

EDIT: As it stands the demo doesn’t even seem to work on mobile so may be useless as a cross browser / platform solution

I am working on it, if it can be useful.

Events example:

1 Like

Thanks @Lawrence3DPK checking it out

Wow pretty awesome @agargaro !
Can I use the Events library with regular THREE.js or do I have to use THREE.ez ?

2 Likes

Thank you :slight_smile:

three.ez extends the functionality of existing three.js objects.
However, it is mandatory to use the main class that instantiates the webgl renderer (which you can of course access) for all mechanisms to work, and you must render views using the createView methods of the main, as in the example.
For the rest, everything is like a common three.js application.

If you have a project already started and can’t/won’t make these changes, I can extrapolate just the part that handles events and send it to you privately.

The project is new, the documentation is still incomplete (except for the API). I can help you privately if you’d like to try it out :slight_smile:

3 Likes