Raycast (geometry nodes)...Does the target geometry need to be an external object?

Hey folks,

In every example of the raycast node I’ve seen on youtube, the shape that is the target geometry isn’t inside the geometry nodes object, it needs to be brought in via an “object info” node. Is it also possible to do raycast where the target geometry is also created procedurally inside the same node setup?

1 Like

Yes. Try it yourself.

2 Likes

I tried, couldn’t get it working properly!

In this film, at 2:57, he plugs “location” from object info into the separate XYZ …if i’m using an internal geometry, what do i plug in there, a “position”?

Coordinates of the internal geometry you created :person_shrugging:
For example, if you instanced the geometry on a point - you might use the location of that point.
There might be other options… depends on what you’re trying to achieve.

From what I see, he only takes the Z-coordinate of the whole object. So, how high is your geometry?

Sorry man, i’m still a bit of a noob, does that (“Coordinates of the internal geometry you created”) mean a “position” node?

Here’s my blend, i’m trying to deform a grid with a pyramid, i’m getting a weird result and i don’t really know what i’m doing anyway.

Actually, whatever i plus into the separate XYZ, seems to make no difference.

I’m know i’m making some fundamental blunder, any ideas?

raycast.blend (911.7 KB)

Well, first of all, you’ve put Map Range and Combine XYZ in the wrong order - so you ended up plugging Value input instead of Vector into Offset. That’s why everything shifted at an angle like this - instead of modifying just the Z-coordinates, it uniformly offsets all of them. just swap the nodes.

Secondly, the Grid object appears at the Center - so it’s location is (0, 0, 0). Meaning 0 is the input for Subtract math node.

Reset values in Multiply and Map range nodes and you should see some improvement.

1 Like

Thanks, i’ll have another go this evening!

Here’s a simplified version - it doesn’t do the same thing as in the video, but maybe might help with understanding Raycast:

raycast_simplifyed.blend (1.0 MB)

Note a value node that moves the grid.

2 Likes

Many thanks, I’m gonna have some fun with this!:

raycast_muckabaat.blend (1.1 MB)

1 Like

The location output is unrelated to raycast, he uses it in a different node. All you need for raycast is a geometry