Stop a rotating object at a specified angle?

Posted by Krummelz on Game Development See other posts from Game Development or by Krummelz
Published on 2012-11-21T22:41:48Z Indexed on 2012/11/21 23:12 UTC
Read the original article Hit count: 264

Filed under:
|
|
|

I'm working in JavaScript with HTML5 and the canvas. I have an object which is rotating at a certain speed, and I need the object's rotation to slow down gradually and the front of the object to stop at a specified angle. (I'm using radians, not degrees.) I have a variable to keep track of the angle which the object is facing, as it rotates.

How would I go about getting the object to come to rest, facing the direction I want it to?

© Game Development or respective owner

Related posts about JavaScript

Related posts about html5