View Single Post
06-17-10, 02:03 AM   #14
Olog
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 8
If you know the angle then tangent gives you the horizontal coordinate one unit away from camera. From the values I used in AVR one unit corresponds to WorldFrame:GetHeight()/2*0.98 pixels.

If dot.angle is in radians then something like this

Code:
c=WorldFrame:GetHeight()/2*0.98
dot:SetPoint("TOP", UIParent, math.tan(dot.angle)*c, 0)
Just take care of the special cases like when the dot is behind the camera.
  Reply With Quote