This is when the target is onscreen.
![Image](http://img221.imageshack.us/img221/2674/targethudmz1.th.png)
This is the result from my code for the offscreen target.
![Image](http://img146.imageshack.us/img146/5442/targethud2wa9.th.png)
The returned angle is wrong.
I create the arrow at a 2D position. My formulae is something like.
Code: Select all
TargetXY = Collide.getScreenCoordinatesFrom3DPosition(Target.getPosition())
TargetAngle = Vector2df.createFromVals(TargetXY.getX(), TargetXY.getY()).getAngle()
ArrowX = (Cos(TargetAngle)*(128-16))+(ScreenW/2)
ArrowY = (Sin(TargetAngle)*(128-16))+(ScreenH/2)
BTW I am writing my game for another programming language using a wrapper.