为了便于用鼠标控制模型的平移、缩放和旋转变换,构建了三种模型变换组件,将3D场景中对模型的多种变换命令用几何图元进行可视化表示,并利用OpenGL选择机制,实现了各种模型变换命令的快速鼠标选择与切换,能够使用鼠标灵活地进行多种模型变换.这些组件已经应用到所开发的虚拟环境及仿真软件中,方便了用户操作,精简了用户界面.
Three components were constructed to visualize the commands of translation,scale and rotation transformation for controlling with mouse expediently in OpenGL-based 3D applications.Each component which represents a model transformation command is assembled by many geometry primitives.The corresponding instruction is parsed out with the OpenGL selection mechanism when mouse suspends over one primitive and the command is executed to transform the model when mouse moves with its button pressed.These assembled groups was successfully implemented and used in simulation software and virtual environment of several related projects.And they make model transformation much easier and convenient.Moreover,they can greatly simplify the user interface.