Diamond and cubic boron nitride films have already been applied practically because of their excellent properties. The specific orientations of the films have special meaning on their application in optics and microelectronics fields. In this paper, the relative electron density differences of the interface between the different crystal planes of silicon substrate and those of diamond and cubic boron films are calculated with the empirical electron theory in solids and molecules. Analyses on the calculation results show that in the range of the researched films, the smaller the relative electron density difference between the film and the substrate is, the stabler the film is in thermodynamics. Therefore, the electron density difference is the essential factor of determining the orientation of the texture and heteroepitaxy of the films. The deductions accord well with the experimental facts. The calculation methods and the theory not only provide a new angle of view for the research of the growth mechanism of diamond film and cubic boron nitride film on the silicon substrate, but also provide a possible direction for the prediction of the orientation of other films. films, interface electron density, texture, heteroepitaxy, diamond, cubic boron nitride