Hi world,
I'm having some issues using the `update_strands_tangents` node.
I created new curve in the front viewport as a straight line using the EP Curve Tool as 3 cubic.
If I pass this curve as is in Bifrost and display its tangents with a `point_scope` it looks ok like this:
But if I place an `update_strands_tangents` in between I noticed the first tangent gets flipped to a weird angle. And if I move all other cvs the first tangent doesn't react.
Is this expected or am I missing something? I was using this to deform a mesh, but the flipped static tangent deforms that bit incorrectly. Here's what the graph looks like:
I'll also attach the scene for anyone who wants to check it out.
Thanks!
Solved! Go to Solution.
Solved by mjcg91. Go to Solution.
I believe this is the last point of your strands. This bug has been going on ever since this compound existed, and has not been fixed since then.
If you have MJCG_compounds, you can look inside update_strands_orientations, there is a sub-compound that you can use, which fixes the boundary tangents.
Ah ok good to know, so I guess I need to calculate the tangent myself by having it look at the point beside it?
Correct, basically the end point's tangent is the direction from the second last point to the last point.
for each strand:
lastPoint = point_position[-1]
secondLastPoint = point_position [-2]
direction = lastPoint - secondLastPoint
lastTangent = normalize(direction)
Yes manually calculating it seems to do the trick! As always thanks so much for the help. Do you suggest using `update_strands_tangents` at all then or just calculate all the tangents yourself?
That's up to you. IMO the current tangent compound is already quite efficient. Aside from the last tangents, the result would most likely be the same.
Obviously the best would be that update_strands_tangents gets fixed 🙂
Can't find what you're looking for? Ask the community or share your knowledge.