I would like the instances to follow the Y axis of the mesh vertices and flow along/follow the surface. The "Align Euler to Vector" node enables alignment along the Z axis, but I cannot get the alignment on another axis.
-
$\begingroup$ You need a vector, that points into the direction of what you call the Y axis of the mesh vertices instead of using the Normal as the Vector input. And you probably need to align the Y instead of the Z axis in this case. $\endgroup$– André ZmudaMay 5, 2022 at 21:22
1 Answer
If you want to work with an existing grid where the directions of the edges along the X-axis and Y-axis are easily separable, you can proceed as follows:
Use the node
Edge Vertices
and get the direction vector of each edge with the math nodeSubstract
.Then convert these vectors to positive values so that you can compare them with the node
Compare
(Equal Direction Vector) and a certain other direction (In this example I compare it with the X-axis and an angle of $45°$, which is $\frac{\pi}{4} = 0.785$ because here it requires radians).This will give you a selection, which you can additionally make switchable with the node
Switch
, as I show in this example (You don't really need this, but it's helpful for testing).If you now convert the mesh into curves using the node
Mesh to Curve
and your selection, you will now get curves on a specific axis where the tangents have been recalculated.The node
Curve to Points
will finally give you the respective rotation of each point and now you can instantiate your cubes directly at these points and use the obtained rotation.