2
$\begingroup$

I have made two objects in geometry nodes (GN):

  1. I took a plane in view port. I increased its size by 20 and then scale it. In Edit Mode, I applied subdivisions two times, first with 10 and then with 4. Next, I applied GN and with GN I applied set position. With vector add math, I connected position and noise texture with the offset of the set position and created a beautiful landscape with mountanous heights on Z axis.

  2. I took a bezier curve in view port and then applied GN. Within GN, I converted this curve into a double fence.

Problem to solve:
I wish to place this double fence surrounding a pedestrian passage on the surface of the landscape. I wish to align the fence along the surface of the landscape so that if I change the noise texture in the landscape, the fence automatically adjusts itself to remain well aligned on the surface of the landscape. Please tell how can I do this in GN.

Please provide the solution in accordance with the latest blender version 4.5 that I am using. Images of my nodes are attached herewith.

Geometry Nodes of Double Fence Geometry Nodes of Landscape

$\endgroup$

1 Answer 1

4
$\begingroup$

If I understand the question correctly, you want to follow a curve along the topology of a terrain.

You can achieve this as follows:

Here I use the Node Raycast, which sends individual rays down to the terrain starting from the curve points.

Note that you must add an additional height on the Z-axis (the height of your terrain, for example) so that the starting position is always above the terrain.

By subdividing the curve several times before moving the curve points to the positions you have determined, the curve will follow your terrain precisely.

Depending on your requirements, you can then subdivide this curve into other intervals and, if necessary, convert it back into a Bézier curve so that it appears smoother.

$\endgroup$
2
  • $\begingroup$ Thank you for your much needed help. Its working now! I appreciate your cooperation. $\endgroup$ Commented Jul 31 at 13:27
  • 1
    $\begingroup$ @UmarMI You're welcome! If your question has been answered to your satisfaction, please be so kind as to mark this answer as “Accepted Answer” so that your question appears as solved. $\endgroup$ Commented Jul 31 at 13:52

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.