-
Notifications
You must be signed in to change notification settings - Fork 14
Improvement: pickingGeometry #10
Description
Do you have any thoughts about adding a pickingGeometry feature, sort of analogous to the pickingMaterial feature?
This is coming up for me in a project I'm working on right now where I'm using troika-three-text to render text. Troika uses a totally custom glyph geometry and custom shaders to render a paragraph of 2D text. I was able to make the object pickable with a custom pickingMaterial, which is awesome, but the geometry that is now pickable is not ideal (see protectwise/troika#177 (reply in thread)).
Now I'm wondering if it might be generally useful to be able to present objects to the picker with alternative pickingGeometries. Would it ever make sense for performance to e.g. use a simpler picking geometry than the one used for rendering to the user?
One challenge I guess, compared to a pickingMaterial, is that you would somehow need to keep the pickingGeometry up to date with the actual transformations on the object. Maybe pickingGeometry should be a function that is called with the real geometry as its argument, and returns a geometry to use for picking?