针对三维CAD模型的交互显示要求,采用已成为三维图形开发标准的OpenGL免费开放3D图形库来进行开发。在深入研究了OpenGL显示机制的基础上,提出并详细讨论了基于OpenGL视景体实现3D模型的交互显示变换方法。基于OpenGL显示系统,通过平移视点坐标系中的视景体实现平移交互显示,通过缩放视景体来实现缩放交互显示,基于矢量计算视点坐标系旋转参数实现任意旋转的交互显示。算法的实际编程应用证明能够有效、灵活地实现三维CAD模型的各种交互显示功能。
Open Graphics Library(OpenGL),the development standard of 3D graphics,is adopted for the interactive display of three dimensional CAD models.The display mechanism of OpenGL is deeply studied,and then a method based on the viewing volume of OpenGL is presented and detailedly discussed for the interactive display.Based on the display system of OpenGL,the translation of the viewing volume in the eye coordinate is applied to the implementation of translation display of CAD models.The scale of the viewing volume is used to scale the display of CAD models.With the help of vectors,the parameters for the rotation of the Eye Coordinate are computed for the rotation display of CAD models.The running of program illustrates that this method can interactively display the three dimensional CAD models efficiently and flexibly.