The invention discloses a method for converting a virtual 3D (Three-Dimensional) scene into a 3D view. The method can be used for converting any virtual 3D scene in
OpenGL into a three-dimensional view by the following steps of: rotating and translating a world coordinate
system, wherein an
observation point is taken as the original point of a new coordinate
system, and a connecting line between the central position of
viewpoints and the
observation point serves as an axis-Z positive axis; determining a rotating angle and a translating distance according to the central position of the
viewpoints and the coordinate of the
observation point; determining the shear mapping angle of each viewpoint according to the central position of the
viewpoints and the coordinate of each viewpoint to generate a corresponding shear mapping matrix, performing right-handed multiplication on a model view matrix of each viewpoint, and projecting to obtain corresponding image data of each viewpoint; and adjusting the coordinate of the 3D scene, the
horizontal resolution of the view, the size of a view
frustum and the positions of the viewpoints according to a constraint condition of a
parallax error and 3D effect experience to improve the 3D effect of the 3D view. Shear transformation and parameter adjustment are inserted in an
OpenGL processing flow, so that the problems of unremarkable 3D effect and the presence of vertical
parallax are solved, and an optimal 3D effect is achieved.