An X-ray tube includes a cathode, an anode, and a deflection device. The cathode and the anode generate an electron beam that is directed toward a target area of the anode to generate X-ray radiation through electrons of the electron beam impinging the target area. The deflection device controls the electron beam such that the electrons hit the anode at different focal spot positions. The deflection device provides gradual deflection for a stepless transition between monoscopic viewing and stereoscopic viewing. For monoscopic viewing, the X-ray radiation is generated from a single focal spot position. For stereoscopic viewing, the X-ray radiation is generated from two focal spot positions spaced apart in a first stereo-direction transverse to a viewing direction. The deflection device provides gradual deflection for a stereo focal spot position in a second stereo-direction, which is transverse to the first stereo-direction and the viewing direction.