Skip to main content
fixed formatting breakage
Source Link
Kuboå
  • 9k
  • 1
  • 19
  • 44

If you just want to stabilize them so you don't really care about which edge of the face they're on they align with, you can simply Sample Nearest edge for its index, then Sample Index for that edge's directional vector using the two Positions from Edge Vertices:

enter image description here

Update: Stabilize for animation

To stabilize the rotations when the mesh is deformed, instead of referencing the nearest edge dynamically, we can do as you've suspected we should, and employ the positions of certain two face corners instead. The Corners of Face node with its Sort Index set to $0$ can get us the first corner. Using Offset Corner in Face set to Offset: $1$ we can select the very next one. We can now subtract the positions of these two corners and capture that information as an attribute on the Face domain to use later in the nodetree for alignment:

Left: Align to nearest edge Right: Align to the first two face corners

With more complex geometry and deformations, even when you stabilize the two axes, the third one can still randomly switch between one direction and its opposite, resulting in unwanted movement. To stabilize the third axis, you can finally align it to the Cross Product of the two previous ones (a third vector that's perpendicular to both):

Left: Two axes stabilized. Third sometimes switching sides. Right: All three axes aligned

enter image description here

If you just want to stabilize them so you don't really care about which edge of the face they're on they align with, you can simply Sample Nearest edge for its index, then Sample Index for that edge's directional vector using the two Positions from Edge Vertices:

enter image description here

Update: Stabilize for animation

To stabilize the rotations when the mesh is deformed, instead of referencing the nearest edge dynamically, we can do as you've suspected we should, and employ the positions of certain two face corners instead. The Corners of Face node with its Sort Index set to $0$ can get us the first corner. Using Offset Corner in Face set to Offset: $1$ we can select the very next one. We can now subtract the positions of these two corners and capture that information as an attribute on the Face domain to use later in the nodetree for alignment:

Left: Align to nearest edge Right: Align to the first two face corners

With more complex geometry and deformations, even when you stabilize the two axes, the third one can still randomly switch between one direction and its opposite, resulting in unwanted movement. To stabilize the third axis, you can finally align it to the Cross Product of the two previous ones (a third vector that's perpendicular to both):

Left: Two axes stabilized. Third sometimes switching sides. Right: All three axes aligned

enter image description here

If you just want to stabilize them so you don't really care about which edge of the face they're on they align with, you can simply Sample Nearest edge for its index, then Sample Index for that edge's directional vector using the two Positions from Edge Vertices:

enter image description here

Update: Stabilize for animation

To stabilize the rotations when the mesh is deformed, instead of referencing the nearest edge dynamically, we can do as you've suspected we should, and employ the positions of certain two face corners instead. The Corners of Face node with its Sort Index set to $0$ can get us the first corner. Using Offset Corner in Face set to Offset: $1$ we can select the very next one. We can now subtract the positions of these two corners and capture that information as an attribute on the Face domain to use later in the nodetree for alignment:

Left: Align to nearest edge Right: Align to the first two face corners

With more complex geometry and deformations, even when you stabilize the two axes, the third one can still randomly switch between one direction and its opposite, resulting in unwanted movement. To stabilize the third axis, you can finally align it to the Cross Product of the two previous ones (a third vector that's perpendicular to both):

Left: Two axes stabilized. Third sometimes switching sides. Right: All three axes aligned

enter image description here

added 580 characters in body
Source Link
Kuboå
  • 9k
  • 1
  • 19
  • 44

If you just want to stabilize them so you don't really care about which edge of the face they're on they align with, you can simply Sample Nearest edge for its index, then Sample Index for that edge's directional vector using the two Positions from Edge Vertices:

enter image description here

Update: Stabilize for animation

To stabilize the rotations when the mesh is deformed, instead of referencing the nearest edge dynamically, we can do as you've suspected we should, and employ the positions of certain two face corners instead. The Corners of Face node with its Sort Index set to $0$ can get us the first corner. Using Offset Corner in Face set to Offset: $1$ we can select the very next one. We can now subtract the positions of these two corners and capture that information as an attribute on the Face domain to use later in the nodetree for alignment:

Left: Align to nearest edge Right: Align to the first two face corners

enter image description here With more complex geometry and deformations, even when you stabilize the two axes, the third one can still randomly switch between one direction and its opposite, resulting in unwanted movement. To stabilize the third axis, you can finally align it to the Cross Product of the two previous ones (a third vector that's perpendicular to both):

Left: Two axes stabilized. Third sometimes switching sides. Right: All three axes aligned

enter image description here

If you just want to stabilize them so you don't really care about which edge of the face they're on they align with, you can simply Sample Nearest edge for its index, then Sample Index for that edge's directional vector using the two Positions from Edge Vertices:

enter image description here

Update: Stabilize for animation

To stabilize the rotations when the mesh is deformed, instead of referencing the nearest edge dynamically, we can do as you've suspected we should, and employ the positions of certain two face corners instead. The Corners of Face node with its Sort Index set to $0$ can get us the first corner. Using Offset Corner in Face set to Offset: $1$ we can select the very next one. We can now subtract the positions of these two corners and capture that information as an attribute on the Face domain to use later in the nodetree for alignment:

Left: Align to nearest edge Right: Align to the first two face corners

enter image description here

If you just want to stabilize them so you don't really care about which edge of the face they're on they align with, you can simply Sample Nearest edge for its index, then Sample Index for that edge's directional vector using the two Positions from Edge Vertices:

enter image description here

Update: Stabilize for animation

To stabilize the rotations when the mesh is deformed, instead of referencing the nearest edge dynamically, we can do as you've suspected we should, and employ the positions of certain two face corners instead. The Corners of Face node with its Sort Index set to $0$ can get us the first corner. Using Offset Corner in Face set to Offset: $1$ we can select the very next one. We can now subtract the positions of these two corners and capture that information as an attribute on the Face domain to use later in the nodetree for alignment:

Left: Align to nearest edge Right: Align to the first two face corners

With more complex geometry and deformations, even when you stabilize the two axes, the third one can still randomly switch between one direction and its opposite, resulting in unwanted movement. To stabilize the third axis, you can finally align it to the Cross Product of the two previous ones (a third vector that's perpendicular to both):

Left: Two axes stabilized. Third sometimes switching sides. Right: All three axes aligned

enter image description here

added 3 characters in body
Source Link
Kuboå
  • 9k
  • 1
  • 19
  • 44

If you just want to stabilize them so you don't really care about which edge of the face they're on they align with, you can simply Sample Nearest edge for its index, then Sample Index for that edge's directional vector using the two Positions from Edge Vertices:

enter image description here

Update: Stabilize for animation

To stabilize the rotations when the mesh is deformed, instead of choosingreferencing the nearest edge dynamically, we can first capture the position of firstdo as you've suspected we should, and second corners of each face withemploy the helppositions of mesh topology nodescertain two face corners instead. The Corners of Face andnode with its Sort Index set to $0$ can get us the first corner. Using Offset Corner in Face. Since now our set to PositionOffset: vectors are based on$1$ we can select the indicesvery next one. We can now subtract the positions of these two corners, which won't change with animation, the direction we get from their subtraction will be stable and capture that information as wellan attribute on the Face domain to use later in the nodetree for alignment:

Left: Align to nearest edge Right: Align to the first two face corners

enter image description hereenter image description here

If you just want to stabilize them so you don't really care about which edge of the face they're on they align with, you can simply Sample Nearest edge for its index, then Sample Index for that edge's directional vector using the two Positions from Edge Vertices:

enter image description here

Update: Stabilize for animation

To stabilize the rotations, instead of choosing the nearest edge dynamically, we can first capture the position of first and second corners of each face with the help of mesh topology nodes Corners of Face and Offset Corner in Face. Since now our Position vectors are based on the indices of two corners, which won't change with animation, the direction we get from their subtraction will be stable as well:

Left: Align to nearest edge Right: Align to the first two face corners

enter image description here

If you just want to stabilize them so you don't really care about which edge of the face they're on they align with, you can simply Sample Nearest edge for its index, then Sample Index for that edge's directional vector using the two Positions from Edge Vertices:

enter image description here

Update: Stabilize for animation

To stabilize the rotations when the mesh is deformed, instead of referencing the nearest edge dynamically, we can do as you've suspected we should, and employ the positions of certain two face corners instead. The Corners of Face node with its Sort Index set to $0$ can get us the first corner. Using Offset Corner in Face set to Offset: $1$ we can select the very next one. We can now subtract the positions of these two corners and capture that information as an attribute on the Face domain to use later in the nodetree for alignment:

Left: Align to nearest edge Right: Align to the first two face corners

enter image description here

added 896 characters in body
Source Link
Kuboå
  • 9k
  • 1
  • 19
  • 44
Loading
Source Link
Kuboå
  • 9k
  • 1
  • 19
  • 44
Loading