Advertisement

2 points and an angle

Started by June 16, 2000 05:28 PM
1 comment, last by pacman 24 years, 6 months ago
I have this really stupid question. I have an object, and when it moves around the screen (overhead view), I want it to always face the middle of the screen. This should be very is to solve, but everything I''ve tried seems to fail. Anybody ever do this before? Anybody have a good way of doing this? pacman
-------------------------------------------The Lord will fight for you; you need only to be still.Exodus 14:14
angle = atan2( center.y - object.y, center.x - object.x );

how''s that?
Advertisement
Yeah, I tried something like that, but now that I think about it, maybe I screwed up some where....

Thanks for the reply
-------------------------------------------The Lord will fight for you; you need only to be still.Exodus 14:14

This topic is closed to new replies.

Advertisement