If i have objectPosithion x,z,y and me position x.y.z , how do i change Screen coods.... i need that method for a mob attact. plz help me..
If i have objectPosithion x,z,y and me position x.y.z , how do i change Screen coods.... i need that method for a mob attact. plz help me..
I actually implemented this a long time ago but never used it. Basically you need 2 steps. First is a 135 degree rotation. Second is a projection between the screen rectangle and the in-game trapezoid region around your character. A bit of trail and error is needed to get the proper scaling.
You will need to find the camera position regardless. Look here: 3D projection
I found this on a seperate site, not sure I am allowed to post link to it, I am new here:
--If you wrote this code, thank you!
Opt("MouseCoordMode", 2) ;1=absolute, 0=relative, 2=client
WinActivate( "Diablo III")
;;--------------------------------------------------------------------------------
;; GetCurrentPosWorld()
;;--------------------------------------------------------------------------------
Func GetCurrentPosWorld()
dim $return[3]
$return[0] = _MemoryRead($_Myoffset + 0x0A0, $d3, 'float')
$return[1] = _MemoryRead($_Myoffset + 0x0A4, $d3, 'float')
$return[2] = _MemoryRead($_Myoffset + 0x0A8, $d3, 'float')
return $return
EndFunc
;;--------------------------------------------------------------------------------
;; MoveToPosClicky()
;;--------------------------------------------------------------------------------
func MoveToPosClicky($_x,$_y,$_z)
$CurrentLoc = GetCurrentPosWorld()
$xd = $_x-$CurrentLoc[0]
$yd = $_y-$CurrentLoc[1]
$zd = $_z-$CurrentLoc[2]
$w = -0.515 * $xd + -0.514 * $yd + -0.686 * $zd + 97.985
$X = (-1.682 * $xd + 1.683 * $yd + 0 * $zd + 7.045e-3) / $w
$Y = (-1.54 * $xd + -1.539 * $yd + 2.307 * $zd + 6.161) / $w
$X = ($X + 1) / 2 * 800
$Y = (1 - $Y) / 2 * 600
MouseClick( "middle", $X, $Y, 1, 0)
while 1
$CurrentLoc = GetCurrentPosWorld()
$xd = $_x-$CurrentLoc[0]
$yd = $_y-$CurrentLoc[1]
$zd = $_z-$CurrentLoc[2]
$Distance = Sqrt($xd*$xd + $yd*$yd + $zd*$zd)
if $Distance < 2 then ExitLoop
if _MemoryRead($ClickToMoveToggle, $d3, 'float') = 0 then ExitLoop
sleep(10)
WEnd
EndFunc