Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Bearing equation

Author
Message
Social Disease
20
Years of Service
User Offline
Joined: 30th Sep 2003
Location: State of Confusion, beyond Denial...
Posted: 1st Oct 2003 14:24
Hello all.
Different post, different problem.
Can somebody out there who is better than me at math share how to determine an object's bearing? What I mean by this is object2 at 90 degrees 100 degrees or 180 degrees from object1?
I'm looking for a simple equation, if it exists.
thanks!

So many games... so little time!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Oct 2003 15:35
It's actually fairly simple ...



That will give you:
a bearing of 0 for 100,100 looking at 100,0
a bearing of -45 for 100,100 looking at 0,0
a bearing of +45 for 100,100 looking at 200,0

If you need a slightly different system of bearings, you can switch the subtractions around (maybe to match sprite rotation etc).
Social Disease
20
Years of Service
User Offline
Joined: 30th Sep 2003
Location: State of Confusion, beyond Denial...
Posted: 1st Oct 2003 18:29
Thanx!


So many games... so little time!
koshi
21
Years of Service
User Offline
Joined: 20th Aug 2003
Location: Cyberspace
Posted: 4th Oct 2003 04:25
eh.. i had the same problem before, but i took like 3 days trying to figure out a equation for it. waste of time.
anyways thanks for the help too, much shorter than the equation.

"Hello this is the suicide hotline, please hold..."
http://www.rovokaa.tk/ -

Login to post a reply

Server time is: 2024-09-21 03:53:48
Your offset time is: 2024-09-21 03:53:48