The present invention has a three-dimensional apparatus including a lattice pattern placed in an optical path and having a slit-like light transmitting portion formed of pitches set at fixed intervals, and a projecting optical system that projects a lattice pattern image formed by the lattice pattern on the sample so that the image is inclined at a predetermined angle. A lattice pitch is determined on the basis of set parameters including the magnification of an observing system. A pattern is formed by the lattice pitch. The pattern is used to pick up a deformed lattice pattern image using a TV camera. An image of each position is acquired while shifting the lattice pattern over several levels. A phase is determined. A height is then determined using the difference between the phase and a basic phase corresponding to a pre-provided magnification or the like. The height is then displayed.