Geo Nodes: follow mesh's Z position with an instance

Hello!

this one is a classic without GN, but with GN I’m getting lost in finding a simple solution. I’d like to generate a water surface with the Ocean mod on a place and then place few object onto it to float there. I’d like to use GN to have the object follow the surface, while I will be animating the XY axis by keyframes, drivers etc. I know I can do this without GN, but GN would allow me do other more interesting stuff, so I hope to find a solution.

I thought I could distribute points on vertices and then have the object find the point with shortest distance to it (or using proximity) and read its Z position value. But this has many issues (esp. depending on the resolution of the ocean mesh) and I can’t even get that idea into nodes…

Any ideas for a solution, or better terms to use when searching for an answer?

Assuming you want to place these cubes (generated at the vertices of the grid plane) down on the ocean surface, I’d use the Raycast node to project the grid plane down first:



raycast_ocean.blend (103.6 KB)

3 Likes

Ohoo! The Raycast node is a node I haven’t known. Thank you for pointing me there!

1 Like