Ich habe diese VB.Net funktion mit der ich in .Net bei meinem radar hack die position des punktes relativ zu mir auf dem radar ausrechne :
in autoit nutze ich diese aber es funktioniert nicht richtig. die punkte werden angezeigt aber nur je nach blickwinkel richtig:
hoffe jemand weis wo drann es liegt ^^
BTW : wie macht man das mit dem doublebuffeed in GDI+ ?
Code:
Shared Function RadianToDegree(ByVal radian As Double) As Double
Return (radian / 180) * Math.PI
End Function
Shared Function _3DWorldTo2DRadar(ByVal My_Position As Point, ByVal enemy_position As Point, ByVal YAW_Radian As Single, ByVal Radar_Breite As Single, ByVal Radar_Höhe As Single, ByVal Radius_2D As Integer) As Point
Try
Dim cosYaw As Single = Math.Cos(RadianToDegree(YAW_Radian))
Dim sinYaw As Single = Math.Sin(RadianToDegree(YAW_Radian))
Dim distanzX As Single = enemy_position.X - My_Position.X
Dim distanzY As Single = enemy_position.Y - My_Position.Y
Dim positionX As Single = ((distanzY * cosYaw - distanzX * sinYaw) * -1 / Radius_2D) + Radar_Breite / 2
Dim positionY As Single = ((distanzX * cosYaw + distanzY * sinYaw) / Radius_2D) * -1 + Radar_Höhe / 2
Return New Point(positionX, positionY)
Catch ex As Exception
End Try
End Function
Code:
Func _ToDegree($radian) Return ($radian/180)*3.14159265358979323846 EndFunc Func _3Dto2D($my_posx,$my_posy,$other_posx,$other_posy,$yaw,$width,$height,$rad = 12) ;MsgBox(0,"",$yaw & @CRLF & $my_posx & @CRLF & $my_posy & @CRLF & $other_posx & @CRLF & $other_posy) $cos=Cos(_ToDegree($yaw)) $sin=Sin(_ToDegree($yaw)) $distance_x=$other_posx-$my_posx $distance_y=$other_posy-$my_posy Local $pos[2] $pos[0]=(($distance_y*$cos-$distance_x*$sin)*-1/$rad)+$width/2 $pos[1]=(($distance_x*$cos-$distance_y*$sin)/$rad)*-1+$height/2 Return $pos EndFunc
BTW : wie macht man das mit dem doublebuffeed in GDI+ ?