OpenGL Rotation of an object around a line

后端 未结 3 1790
陌清茗
陌清茗 2020-12-17 04:21

I am programming in OpenGL and C++. I know 2 points on 1 line (a diagonal line) and wish to rotate an object around that diagonal line. How can I go about doing this? I know

3条回答
  •  粉色の甜心
    2020-12-17 04:52

    glrotate does the rotation about an axis. One method is to perform transformations which align rotation axis with one of coordinate axis, perform the rotation, then reverse the first step. If you need speed you can combine the operations into a special transformation matrix and apply them in one step. There's a description here.

提交回复
热议问题