摘要
通过鼠标的拖动来实现三维物体的旋转,通常的做法是使场景绕X,Y,Z轴旋转,其不能达到图形可以随着鼠标的拖动绕任意方向旋转的预期效果,旋转有停滞、逆转和卡动现象.本文通过在屏幕外虚拟构建一个单位球体,将鼠标点击的屏幕上的二维点映射到球面上用以产生虚拟的Z坐标来计算旋转参数,并根据四元数计算方法实现鼠标拖动下三维物体绕任意方向的流畅旋转.彻底消除停滞逆转和卡动.
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 .
出处
《西安工业大学学报》
CAS
2014年第11期878-881,共4页
Journal of Xi’an Technological University
关键词
弧球
OPENGL
旋转
四元数
坐标转换
arcball
openGL
rotation
quaternion
coordinate transformation