Jump to content

Recommended Posts

Posted

Hiya, im working on a project of mine, im trying to get the current angle of my avatar inn a simple game.

But i only have these data available, X, Y cords.

So this is my idea, i store my current cords then move the avatar a litle then compere the new cords with the old, then calculate angle, anyone know if this is possible?

UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
Posted (edited)

Yes. The question is now, how well do you know trigonometry?

The way I'd do this is to construct a small right triangle using the pair of points of the character position to form the hypotenuse. From there, you can fill in a right triangle. Use a little math to solve for certain sides, and arccos, arcsin, or arctan an angle out of it.

Edited by Richard Robertson

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...