According to the existing problems of structural representations and analysis methods of spatial kinematic chains, a new method based on constraint function and adjacent matrix was presented. The constraint function in form of vector was firstly defined according to the constraint features of kinematic pairs. Next, the properties of constraint function were analyzed. Then, an adjacent matrix of the kinematic chains with constraint functions as elements was proposed. At last, the topological structures of spatial mechanisms were represented and analyzed by using the constraint function and the adjacent matrix. The results show that the constraint function can be applied to all kinds of kinematic pairs, which can represent comprehensive information about the type, grade, DOF, direction, properties and their changes of kinematic pairs. And the adjacent matrix of kinematic chains can be used for non-instantaneous representations and analysis of all kinds of mechanisms, which can give an overall picture of the number of links and the number, the type, grade, direction, properties of kinematic pairs, as well as the type, DOF and the spatial layout of mechanism. Two examples show the intuition, effectiveness and simplicity of using constraint function of kinematic pairs and the adjacent matrix of spatial kinematic chains to represent and analyze spatial mechanisms.