Well, I can give it a try, but it might end up in a lot of "if you ..." because I dont know how you are doing movement and rotation yet.

Your question was ...
Quote:

... need to play with tanks tilt and roll, but I don't have any ideas how to make this according to turret pan.


So my guess is that tilt and roll for the tank can be calculated with sin and cos :

// factor = the angle for the swing movement
// should be a small movement, so something between 2° and 5° should be appropriate
tank.tilt = cos(turret.pan)*factor;
tank.roll = sin(turret.pan)*factor;
(btw I mixed up sin and cos in my first post and just corrected this)

So, if turret.pan = 0 then cos = 1 and sin = 0 => only tank.tilt movement,
if turret.pan = 90 then cos = 0 and sin = 1 => only tank.roll movement
if turret.pan = 180 then cos = -1 and sin = 0 => negative tank.tilt movement
...
and for other turret.pan values (e.g. 47°) it's a combination of tilt and roll

The rest of the example was just to make a smooth movement between zero and target angle and backwards.
This movement is not accelerated which should not be a problem because the whole activity should be less then 1 second (guess +0.5 sec would be good) and a quite small movement.

This should have been the easy part. But now the promised "if you ..."

If you already doing rotation (which I guess would be the case), then you need to do the "swing" rotation additionally. If you do rotation via just setting the pan - fine, just set tilt & roll as mentioned before. If you use c_rotate then you have to combine the rotations in you c_rotate call.
If you use c_rotate it also depends if you do the call with USE_AXIS, USE_AXISR or without.

Next ... the rotation could lead to a collision with the terrain. If you use an elliptic hull this might not matter for this small rotation.

Quote:

BTW, I use three different models, one for tank's base, one for turret's base and the last one for barrel.


If these three models fit together without changing the origin coordinates by code then the swing-rotation could be done for all three models the same way.
Depending on the way you are doing rotation currently it might be necessary to calculate the difference between the turret.pan and the tank.pan ...

Now, this "if ..." could be continued endlessly but I guess this would be useless.
So, if you got the idea and its suitable for your needs - fine.
If not, I would recommend to post your movement code here. Otherwise there are too many different ways foreward.