Say you have generated a Grid of Spheres in a 3x3 Grid. Is it possible to select any of those Spheres with an input device?

Comments

Yes, there are different ways

jstrecker's picture
Submitted by

Yes, there are different ways you could accomplish this with some math.

One would be to check if the pointer is within a certain distance of each individual sphere's (x,y) center point — sphere-hover-distance.vuo

Another would be to calculate which grid space the pointer is in — sphere-hover-grid.vuo

Btw, I'm not totally clear on what you mean by "select", but hopefully one of the two compositions matches what you had in mind. The first one draws a selection indicator (square) behind the sphere being hovered. The second picks out the sphere being hovered and does something to it (replaces it with a cube).