Simulating real virtual ocean environment is necessary for the research of interaction simulation of underwater gravity aided inertial navigation system. One of the key techniques of realizing virtual ocean environment is modeling and simulating three-dimensional ocean waves. Numerical simulation of three-dimensional ocean waves in the case of different wind speeds is realized using MATLAB based on directional spectrum composed of Pierson-Moscowitz frequency spectrum and directional spreading function. Experiments show that the simulation speed is fast and the simulation results are vivid if suitable simulation frequency band, interval of wave frequency and interval of direction angle are selected. The simulation can provide some technological supports for interaction simulation of gravity aided navigation system for underwater vehicles.