The visualization of rock structure is a very useful and important technique in many aspects in geological and geotechnical engineering such as investigating and evaluating the stability of a high rock slope. The conventional method used to visualize rock structure is limited to plotting the orientation of individual discontinuities by using the Schmidt stereographic net. The present paper shows a new technique to visualize the three-dimensional structure of rock masses. The fitting function for three-dimensional rock structure was established based on data gathered from field survey. Two fitting methods by which the discontinuous points gathered from a plane and discrete points from field survey were fitted respectively are suggested. The technique to visualize the three-dimensional structure of rock masses includes many aspects such as projection transformation, blanking and mutual cutting, are investigated. Based on the visualizing technique, the rock structure at the site of Xilupdu dam which is being built in Southwest of China was investigated.