Selecting/highlighting regions on the surface of a sphere?

Godot Version

v4.2.1

Question

I am trying to create visual feedback for selecting from a uniform set of points on a sphere. The effect I would like would be for the non-culled portion of the sphere on mouseover to highlight a sub-region on the surface of the sphere is, on selection the sub-region stays lit and emits a signal while highlighting under the mouse persists.

Most of that I can do, the thing I don’t understand is how do I segment a sphere and highlight only a subsurface? I’ve worked with shaders and can see a way to do it through a lot of math and constantly updating parameters in the shader through a node but I’m hoping there’s an easier way to do something like this.

I’ve found two solutions since this post:

  1. is the “correct” solution which is taking the shape normal from the input mouse event, calculating it’s position on the sphere (which is trivial) and then adjusting the shader to respond accordingly.

  2. is the way I prefer because it fits the aesthetic I’m working for. I’m going to build either a geodesic or goldberg polyhedra and emit a signal for each face. It will work much better for the mechanic I’m going for.

Figured I’d post this for the next poor fellow looking into it.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.