realbasic-games
[Top] [All Lists]

WorldToObjectTransform question

To: RB Games <realbasic-games at lists dot realsoftware dot com>
Subject: WorldToObjectTransform question
From: Paul Kaiser <buddy at goodlearning dot com>
Date: Fri, 11 Jun 2004 14:28:46 -0500
Delivered-to: realbasic-games at lists dot realsoftware dot com
List-help: <mailto:realbasic-games-request@lists.realsoftware.com?subject=help>
List-id: REALbasic Games <realbasic-games.lists.realsoftware.com>
List-post: <mailto:realbasic-games@lists.realsoftware.com>
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)

From this, if I wanted to, I could get the x and y difference from enemy to player:
relativeVector3D.position.x
relativeVector3D.position.y

How can I get the relative angle from enemy to player?
(That way I could try to turn my enemy towards the player)
I know I could do some trig with the x and y positions easily enough, but I'm thinking there is a more efficient method with Vector3D that I'm just not gleaning from the Language Reference.

This is a 2D environment, BTW.

Thanks,
Paul Kaiser

_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>