### Author Topic: 5.0.1 Banking issue  (Read 839 times)

#### Dragan

• Hero Member
• Posts: 1298
##### 5.0.1 Banking issue
« on: October 15, 2021, 04:47:59 PM »
Please check the scene file. It seems that the Banking position has no effect and the Subspline is also affected.
It would be nice if Banking can be dependent on the SubSpline order like Markers.
Also, it would be nice if we can have Spline Position/Angle as User Data parameters.
btw. Markers are working as expected.

« Last Edit: October 16, 2021, 09:20:35 AM by Dragan »

#### iToo

• Hero Member
• Posts: 4126
##### Re: 5.0.1 Banking issue
« Reply #1 on: October 18, 2021, 11:35:57 AM »
This is a bug. Banking is not handled correctly by sub-spline, as it should.
I already fixed for next update.

Banking value can be used on expressions using: XSplineXDirection, XSplineYDirection, XSplineZDirection.
XSplineXDirection is the tangent vector over the spline, XSplineZDirection is the up vector, and XSplineYDirection perpendicular to both.

Banking angle can be computed from vectors using this expression:

# Banking angle to local XY plane. Limited to [-180,180] (0 = vertical)
vector z0 = [0, 0, 1];
vector vz = XSplineZDirection;
real angle = radToDeg(atan2(length(crossprod(z0, vz)), z0 * vz));
return angle;

I've attached a (completely useless) example, where Segment Z size is proportional to the banking angle.

Carlos Quintero
iToo Software

#### Dragan

• Hero Member
• Posts: 1298
##### Re: 5.0.1 Banking issue
« Reply #2 on: October 18, 2021, 11:55:16 AM »

Thank you Carlos.
It will be tricky for newbie users to get all those expressions especially because they can easily manipulate with Angle at Modifier state but back in the expressions they need to think about vectors, spline directions, etc.
If you'll be able to add expression attributes like `Banking Angle[0]=40 deg` to match the Banking modifier order/angle it would be great.
I know it is a huge task but even without improving anything for expression, Banking is really nice feature as it is. Just those few bugs to be solved and I think it is ready for production. I guess 99% of Users will use this feature via viewport.
« Last Edit: October 19, 2021, 12:30:02 PM by Dragan »