Highlight some paths on hover on a sphere with a gridMaterial

Hi there

Here’s my Playground

I’d like to highlight lines intersection by a circle of a different color or ton, on hover on them. Accuracy is clearly defines as a circle radius: everytime you hover to any lines intersection closer than the radius - circle appears, when you get outta it - it disappears

You would need a different shader for that unfortunately :frowning:

I hope the community will come up with smthg highly creative regarding this :slight_smile:

Heya, here’s a PG demo of one way to do this that I’ve been playing with. :smiley:

So on the mouse move event the nearest grid joint’s position is calculated and passed to the shader.

The constant named cutoff (line 79) filters out the faded/empty areas in between the 6 main sections of the grid, in case you need to adjust that…

And then the NME version of the GridMaterial has a small customization to draw the circle (most of the new blocks are in the Circle frame in the upper-right corner of the graph).

Hope it helps and let me know if you have any questions about it. :slight_smile:

3 Likes

This is great !!! Keep up this amazing work !!!

Can’t reuse the code localy

As I see, it uses some snippet. Can’t load it either :smile:

It uses a NodeMaterial which must be loaded. If you have internet connection it should work as is but you can also click on the material’s link below, then on the right-side menu, under File, click Save to save it to a JSON file. And then you’ll need to use ParseFromFileAsync instead of ParseFromSnippetAsync. :slight_smile:

1 Like

Nice, yeah, it worked. I was a complete dumb

BTW can I set color for a circle? :smile:

No worries, you can set the value of the “circleColor” block to whatever color you want like this on line 59 . :slight_smile:

1 Like