Rotating Towards Path in OpenGL
问题 I am having trouble on how to rotate an object in 3D space, based on the OpenGL rotate function glRotatef(..). glRotatef ( angle , x , y , z ) My object is traveling from one point to another in 3D space. I want my object to rotate in the direction it is traveling. How would I find the angle, x, y, z that is needed for the glRotatef(...) function if I know the point where I am starting and the point where I am finishing. 回答1: The gluLookAt function is exactly what you need here. It will save