Theory of the photoelastic effect in ZnO, ZnS and CdS crystals