3
$\begingroup$

I try user Raycast with "Align Euler to Vector" node. Target is simple rotate plane (4 vertex).

As a result, some triangles are rotated incorrectly. What's wrong ?

enter image description here enter image description here

$\endgroup$

1 Answer 1

6
$\begingroup$

Here's how your setup is evaluated:

  1. White line ⬅ Group Output decides to evaluate the Geometry
  2. Cyan lines ⬅ Instance on Points decides to evaluate Points, and evaluated data returns on yellow lines ➡. Nodes (1) - (4) were evaluated.
  3. Pink line ⬅ Instance on Points decides to evaluate Instance, and evaluated geometry returns on the green line ➡. Node (5) was evaluated.
  4. Red lines ⬅ Instance on Points decides to evaluate Rotation for each instance, and evaluated vectors return on the blue lines ➡. Nodes (6) - (8) were evaluated.
  5. Instance on Points finishes work, returning the data to Group Output on the black line ➡. Nodes (9) & (10) were evaluated.

I tried to make it clear Object Info and Raycast nodes are evaluated two times each. So if you duplicated those nodes, I think the execution would be exactly the same (maybe some optimizations wouldn't kick in, but other than the evaluation time, the result would be the same):

While the Object Info node might have some cache, because it returns the same data the second time, the latter, the Raycast, is given different Source Position - the 2nd time it's the position of the instance, which is already positioned on the plane.

So it is now up to the quirkiness of the floating point calculations if a ray shot from the plane down will hit the plane or not. With node wrangler enabled, CtrlShiftclicking the Instance on Points node (the context) and the Raycast node (to read values for this context) will reveal Is Hit for many instances (those with wrong rotations) is ❌ False.

The simplest fix is to edit Plane.001, duplicate the plane and move it down. Now there's a second plane with the same normal to be sampled by (7) node.

The proper fix is to use a Capture Attribute node, to remember the Hit Normal to not have to run the node again (it will therefore also reduce the evaluation time of the setup):


More reading:

$\endgroup$

You must log in to answer this question.

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