Download

How to find tangent of a spline at an offset ? (Plenty of pictures inside!)

Anyone has ever tried to scale a spline mesh with an offset from the original spline? In my case, I have a spline (1) making a ladder.
To the spline, I add meshes to make rungs (2) and rails (3) but when I scale a spline point the tangents get all screwed up, this is because they are still calculated on the main spline which is mostly vertical. The arrows in the pictures are to represent the currently calculated tangents.


This is what happens when I scale one spline point:

As you can see the tangents are unchanged, here you can see the tangents visualization if I place them in their “correct” position:

My question would be, how do I find the tangent of the scaled spline at an offset? The engine is already calculating a preview for me so it should be possible?

If anyone stumbles upon this in the future, this is how I fixed my problem. Instead of relying on a singular spline, I recalculate a spline for each rail (just a point per point copy of the main one with correct offsets applied) and then use that one without any scaling