A new analysis method on X-ray diffraction has been developed to study local structure of a long-range ordered crystal. The shell structure factor is defined here in order to extract the X-ray intensity by resonant scattering from the total scattered intensity. The method can make visible a kind of atom where the K-or L-shell electrons undergo dominant resonant scattering near the absorption edge. Because the other atoms remain transparent, the positional shift of particular atoms from their averaged position can be detected in crystallographically unique sites. Local structure of orthopyroxene, (Co, Ni, Zn) Si03 is discussed as an example.