A stereoscopic endoscope that includes at least one image sensor, one or more processing devices, and a display device. The image sensors sense a pair of stereo images, based on capturing light passing through apertures electronically defined at a first aperture location and a second aperture location, respectively, on a liquid crystal layer within the endoscope. The one or more processing devices determine an orientation of a line connecting the first and second aperture locations relative to a reference orientation, and adjust at least one of the first and second aperture locations, while maintaining a spacing between them, in response to movement of the stereoscopic endoscope. The image data captured through the apertures is used to generate control signals representing one or more views of a surgical scene. The views are then presented on a display device.