1. A three-dimensional measuring apparatus comprising: a light source which emits an illumination beam; a lattice pattern which makes the illumination beam into a plurality of parallel slit beams to form a lattice pattern image; a projecting optical system which projects the lattice pattern image on a sample so that the image is inclined at a predetermined angle; a lattice pattern projecting section provided on an optical path for the illumination beam and having the lattice pattern and the projecting optical system; a microscope used to observe the sample and the lattice pattern image reflected by the sample; and a focusing section which moves the microscope to adjust a focal position with respect to the sample.