A system for measuring the spatial dimensions of a three-dimensional object employs a lens and at least two detectors. The combination of which defines two or more object planes. The combination of the lens and the detectors define an optical axis that is normal to the object planes and passes through a focal point of the lens. At least a first and a second photodetector are optically aligned with the object through the lens. The first and second photodetectors or array of detectors are further parallel with the surface but have differing elevations relative to that surface. In addition, the first and second photodetectors are capable of motion relative to said object. Electrical output from the first and from the second photodetectors is provided to a processor that determines a distance of the object from the lens and thereby a height of the object. This system is particularly suited for measuring the spatial dimensions of solder balls mounted to a surface of a ball grid array (BGA) electronic package.