0
$\begingroup$

This may be a basic question, but I have been struggling with this problem for a few evenings now. I want to create a GN system where I have:

  • a grid, with a noise node to create some displacement
  • a curve with a radius
  • instances along the same curve, that follow the direction of the curve but that are rotated according to the normals of the plane.

The set up works perfectly if my grid is completely flat, but as soon as I increase the noise to create some hill then the instances seem to be oriented randomly, and not along the normals of the distorted grid. I tried a lot of different systems, tried to apply many techniques I found also on other questions on here, but I am not sure why it doesn't work for me. How can I achieve this result?

enter image description here

$\endgroup$

1 Answer 1

2
$\begingroup$

That the cubes happen to align with the grid with no displacement is just an accident-- a broken clock right twice a day. We can see that with any arbitrary transform, the cubes don't follow the grid:

enter image description here

This shouldn't surprise us, because our grid's normals in no way interact with the rotation of the cubes. The cubes' rotations, in the GN you've provided, are determined only by the tangent of the curve-- the direction that the curve is going.

But you haven't fully defined your rotation, because there are any number of different orientations that point the X axis along the tangent-- it could rotate freely about its X axis without changing where its X axis is pointing. We can fully define it by using two sequential align to Euler nodes, first aligning the X to the tangent, and then pivoting about the X axis to point the Z axis in the same direction as the nearest surface normal of the grid:

enter image description here

(I'm using monkeys here rather than cubes because monkeys have a little less symmetry, so we can identify their axes better.)

$\endgroup$
1
  • $\begingroup$ Omg I am so glad I asked! I would have never got there by myself. Thank you so much! I was feeling so close, but clearly I was also so far at the same time. I had tried to use the "Sample Index" node, the same way you used the "Sample nearest surface" node but that didn't work at all. $\endgroup$ Nov 21, 2023 at 10:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .