1. A shape measuring apparatus that measures a three-dimensional shape of a measuring target, the apparatus comprising: a lighting device that irradiates the measuring target placed on a stage with light; an imaging device that takes an image of the measuring target; a shape calculating device that calculates orientations of normals at a plurality of points on a surface of the measuring target from an image, the image being obtained by performing imaging with the imaging device while the lighting device irradiates the measuring target with the light, the shape calculating device calculating the three-dimensional shape of the surface of the measuring target from the calculation result of the orientations of the normals; a ranging device that measures a distance from a predetermined reference position with respect to at least one point on the surface of the measuring target; and a determination device that determines a spatial position of the three-dimensional shape of the surface of the measuring target, the three-dimensional shape being obtained by the shape calculating device using information on the distance obtained by the ranging device.