two.js icon indicating copy to clipboard operation
two.js copied to clipboard

Interactive Support only for SVG Renderer?

Open jinspiration opened this issue 6 years ago • 4 comments

I am sorry if the question is trivial. In the docs, I only see one example featuring mouse event response through svg element. Does two.js only have interactive support for svg renderer? Thanks!

jinspiration avatar Aug 18 '18 00:08 jinspiration

That is correct. There isn't hit-test logic built into Two.js yet. So, at the moment the only manner I'd through SVG.

jonobr1 avatar Aug 18 '18 13:08 jonobr1

This ticket will serve as a good thread to start tracking features on hit test logic.

jonobr1 avatar Aug 26 '18 10:08 jonobr1

I described in issue #209 a two.js hit test demo I wrote some time ago (it can be tested here).

It takes advantage of rbush for efficiency and is renderer agnostic. HTH.

oparisy avatar Jan 03 '19 13:01 oparisy

Thanks for sharing. That's a great point of reference and looks like it could be a good avenue to implement not just hit testing but frustum culling as well.

jonobr1 avatar Jan 04 '19 21:01 jonobr1