Length Preservation Fix
Original post here.
I was curious about how much of a difference it would make if I scaled the verts back after the major tree bend offset. And it turns out worth the effort. (It was just a few nodes actually)
As I explained, we need to find the root position and calculate the length of every vert’s distance from the root.(Length) And we preserve this value and scale the post-offset distance between the vert and the root back to the preserved original length.
L0 is the preserved length
P is vert’s position
R is root’s position
P′ is the position of the vert after wind factors
normalized means to only get the unit vector which is the direction of the transformation.
The equation is basically what the gif on top demonstrated. The bent direction is normalized and rescaled to the original length.
The pivot of the tree is at the root position, so the root is (0,0,0). The equation becomes
P’ = normalized Pbent * L0
All in Object Space
Reminds me of fk hierarchy.
Also preserved length in that case.