I think what he meant is that right now you only have a "distance from center" box. But a gun point could be translated anywhere (and I feel like a dumbarse for not realizing this before) along the x, y, and z axis, and all of those would mean different normals. If you have a gun point 20 meters from center, is it 20 meters vertically, horizontally, or forward/back?
So what I said before is incomplete. The calculations should be the same for x and z, but you will also need to calculate the normalized 'y' component too, so the guns will tilt up or down if they're moved up or down.
So you need three cells for 'gunpoint offset from center'. Here:
As you can see, even though the red gunpoint in "2" is the same distance as the red gunpoint in "3", the normal vector values are different because the one in "3" is moved to the right, while the gunpoint in "2" is moved back from the center. Also note that while both gunpoints in "3" are 1m to the right of the center of the spacecraft, the angle is slightly different for the pink gunpoint because it is also moved back 1 meter. "4" shows the distances I used for the calculations.
That same graph above could be used for y values. Rotate it to the left 90 degrees, and swap the "x" and "y" values; the z values will remain the same. (assume a conical spacecraft
)
I wasn't too careful with the calculations so they could be wrong, but the signs and general magnitude look OK.