At 2:28 PM -0500 6/11/04, Paul Kaiser wrote:
WorldToObjectTransform gives me a Vector3D that, when added to the
original Vector3D, would get me to the destonation Vector3D, if I
understand correctly:
relativeVector3D = enemy.WorldToObjectTransform(player.position)
Well, sort of -- it also takes orientation and scale into account,
not just position.
From this, if I wanted to, I could get the x and y difference from
enemy to player:
relativeVector3D.position.x
relativeVector3D.position.y
Well yes, but you can more easily get that via enemy.position.Minus(
player.position ).
How can I get the relative angle from enemy to player?
In a 2D game (or 2D situation in a 3D game), I'd recommend using
ATan2. That's what it's for, and it's very good at it. :)
Best,
- Joe
--
,------------------------------------------------------------------.
| Joseph J. Strout REAL Software, Inc. |
| joe at realsoftware dot com http://www.realsoftware.com |
`------------------------------------------------------------------'
_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|