Li,

Thanks a lot. I am currently reading 3D Math Primer and I am trying to
link the stuff in the book (c++) to AS3.
What I want to do is a simple radial radar the shows enemie-positions
around the player object.

Thanks for your help, Patrick

On Feb 7, 7:26 am, Li <[email protected]> wrote:
> I'm not sure if there is a native method, but something like this should
> work (based on the dot product of 2 vectors):
>
> var obj1Vector:Number3D = obj1.position;
> var obj2Vector:Number3D = obj2.position;
> var cosAngle:Number =
> obj1Vector.dot(obj2Vector)/(obj1Vector.modulo*obj1Vector.modulo);
> var angle:Number = Math.acos(cosAngle);
>
> This will be the angle between the positional vectors of the objects in the
> plane they define.
> I'm not sure what you mean by Y-angle, but just post more details if this
> doesn't help you.
>
> On Sat, Feb 7, 2009 at 4:44 AM, Patrick <[email protected]> wrote:
>
> > Hi All,
>
> > Is there a method to retrieve the Y-angle between two objects, while
> > both objects are moving?
>
> > Thanks

Reply via email to