基于OpenGL实现的三维物体绕任意轴旋转 |
| |
引用本文: | 姚红革,鬲文娟.基于OpenGL实现的三维物体绕任意轴旋转[J].西安工业大学学报,2014(11):878-881. |
| |
作者姓名: | 姚红革 鬲文娟 |
| |
作者单位: | 西安工业大学计算机科学与工程学院 |
| |
摘 要: | 通过鼠标的拖动来实现三维物体的旋转,通常的做法是使场景绕X,Y,Z轴旋转,其不能达到图形可以随着鼠标的拖动绕任意方向旋转的预期效果,旋转有停滞、逆转和卡动现象.本文通过在屏幕外虚拟构建一个单位球体,将鼠标点击的屏幕上的二维点映射到球面上用以产生虚拟的Z坐标来计算旋转参数,并根据四元数计算方法实现鼠标拖动下三维物体绕任意方向的流畅旋转.彻底消除停滞逆转和卡动.
|
关 键 词: | 弧球 OpenGL 旋转 四元数 坐标转换 |
Realization of 3D Rotation Based on OpenGL |
| |
Authors: | YAO Hong-ge;GE Wen-juan |
| |
Affiliation: | YAO Hong-ge;GE Wen-juan;School of Computer Science and Engineering,Xi’an Technological University; |
| |
Abstract: | The usual way for 3D objects to rotate by mouse clicking is to rotate the 3D models around the X ,Y ,Z axises .But it can not achieve the expected effect because of stagnation and reverse in rotation .In this paper ,a new method is presented that a virtual unit sphere outside the screen is constructed ,onto which the two-dimensional point is mapped to form a virtue Z axis for calculating rotation parameters .And then a smooth rotation in any direction is achieved by the quaternion method , without any stagnation and reverse . |
| |
Keywords: | arcball openGL rotation quaternion coordinate transformation |
本文献已被 CNKI 维普 等数据库收录! |
|