Systems of rigid particles are in solid and liquid states depending on the number of interparticle contacts. Solid (glass or crystal) and liquid states were determined from the ability of a system to resist the shape change under external force. As a criterion of the liquid to glass transition the equality of the number (translational and rotational) degrees of freedom F and the number of constraints of these motions C (F=C) was used. System is solid if FC. In systems of rigid particles constraints are due to mechanical contacts (C1) and chemical bonds between the particles (C2). Glasses were classified as mechanical (granular systems and metallic glasses) if C1C2, chemical (non-organic glasses) if C1C2, and combined (polymer glasses) if C1C2. Some results of computer imitation confirming the transition criterion are presented.