The invention relates to an optical system for generating a pattern which changes over time for a confocal microscope. The system includes a light source arrangement, a beam splitter, and a lens arrangement. The beam splitter allows for passage of a light beam proceeding from the light source arrangement in the direction of an object and for deflecting the reflected light beam, reflected by the object in a focal plane, in the direction of a detector. The detector includes a detector pattern for detecting an image of the object. The lens arrangement is between the beam splitter and the object and includes: a light source that generates the light beam, and a device configured to switch a direction of polarization of the light beam to generate a changing projector pattern.