• Advertisement

Archived

This topic is now archived and is closed to further replies.

Point Rotation Help

This topic is 5906 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Quick Brief: I am making an overhead car game (how original) and i am using a point on each corner of the car to test for collision. The idea was to rotate the point with the rotation of the car. The problem: When I rotate the points using Xnew=(X*(cos theta))-(Y*(sin theta)) Ynew=(X*(sin theta))+(Y*(cos theta)) The point spirals into the center! the rotation i am after is 22.5 degrees an i am converting to radians using rad=deg*(pi/180) Any help will be much appriciated,Thankyou

Share this post


Link to post
Share on other sites
Advertisement
Your formulas are good. I think it''s due to rounding error : by applying multiple rotation each followed by a rounding, the dimensions of your car are modified (shrinking). You should keep somewhere the actual angle of rotation of your car and apply the rotation to the "angle 0" or original car at each time.

hope so...

Share this post


Link to post
Share on other sites
hi

well your formulae are correct. make sure you are not performing rotations on already rotated points. ie. keep an array of ORIGINAL points which never alter. when it comes to rotation, base your calculations on the original array and store the result in the new array.

Share this post


Link to post
Share on other sites
Thanks i''ll try that, I did try after 360 rotation had happend to reset the starting points, but it didnt change the spiral, but yes i was rotating rotated points


Share this post


Link to post
Share on other sites

  • Advertisement