Each turret can point in any direction it needs to. This is called Local Control. Typically all turrets are controlled by the main director tower aloft. This sights the target and the turrets align with the readings from the director. This is to make sure all turrets are pointing at the same target because at 15 miles its difficult to distinguish one target from another.
The director also fires all the guns at the same time to eliminate timing errors.
Long range gunnery requires salvo firing with a number of shells fired at the same time to ensure a percentage should hit otherwise its impossible.
In poor visibility when expecting an enemy sighting but not sure where from ships would often sail with some turrets pointing starboard and others to port in local control so if they enemy is sighted they can react quickly.
With big guns each gun can typically fire two rounds a minute but at long range it can take 90 seconds for a shell to land so they have to wait and see where the shells land before they can correct the aim.
The technical side is extremely complex. They have to take into account the rifling of the guns, how many shots each gun has fired (barrel wear) the wind, the temperature of the cordite, the atmospheric pressure and even the rotation of the earth to control creep plus the ship speed, inclination, role, yaw and pitch!!
They had mechanical computers called Dreyer tables to make the calculations.
Cheers
Geoff