Change local rotator to another one local

Hello !

I really need your help ! (Maybe i’m dumb but I hope not)

I have turrets to rotate depending of the camera’s rotation. (they are fixed on a ship.)

for those which have the same coordinates (same X, Y & Z vectors), it’s really easy.
But for those which have a local rotation (based on a socket rotation), it’s more complicated.
They have the same X but the local Z of the camera is the local Y of the turret, and the local Y of the camera is the local Z of the turret.

I found the local rotation of the camera depending of the ship, and the vertical cannons are in local coord too.

To control the turret I have the base rotation in ° (0 to 360) and the cannon’s elevation in ° (0 to 90)

Maybe a simple function exists. or maybe passing to world coord then back to local coord … I tried all the week end .
Thanks for reading !

So I did it with another method … All is fine now !