Skip to main content
Tweeted twitter.com/#!/StackGameDev/status/637857533508612096
Removing the torque tag. Those parentheses at the end strike me as very unnecessary, but not finding a better way to incorporate that data so I'll hold off on that one myself.
Link
Source Link
Karantza
  • 452
  • 4
  • 9

Changing orientation by applying torques

Suppose you've got an object floating freely in space. You have a vector you want this object to point towards, and a vector representing the direction it's currently facing. From these two, you can get the rotation (matrix, quaternion, whatever) that represents the change in orientation to bring the two vectors into alignment.

If you only have the ability to apply torque (derivative of angular velocity) to your object, what's a good algorithm for applying torque over time that won't over/undershoot the destination?

(In this case, it's a space ship that wants to automatically orient itself in the direction of travel using thrusters. Roll is irrelevant.)