sphexion Posted April 16, 2015 Share Posted April 16, 2015 This is my first edition of the function. Lots can be don from just this. What it does it scans in a Circumference. Aka a circle around as designated. I wanted a optimized way of pixel searching and came up with this to be the best preforming. Local Const $180_div_pi = 180 / ACos(-1) $it = _PixelSearchCircumference(194, 762, 160, 0xFA3C32) MouseMove($it[1],$it[2],0) Sleep(5000) Func _Angle($tX, $tY, $cX, $cY) $mx = $tX - $cX $my = $cY - $tY $angle = ATan($my / $mx) * $180_div_pi If $mx < 0 Then $angle = 180 + $angle ElseIf $mx >= 0 And $my < 0 Then $angle = 360 + $angle EndIf Return Int($angle) EndFunc ;==>_Angle Func Angle($X1, $Y1, $Ang, $Length) Local $Return[3] $Return[1] = $X1 + ($Length * Cos($Ang / 180 * 3.14159265358979)) $Return[2] = $Y1 - ($Length * Sin($Ang / 180 * 3.14159265358979)) Return $Return EndFunc ;==>Angle Func _PixelSearchCircumference($centerX, $centerY, $radius, $color) For $i = 0 To 360 Step +1 $rod = Angle($centerX,$centerY, $angle, $radius) $iColor = PixelGetColor($rod[1] , $rod[2]) If $iColor == $color Then Return $rod ExitLoop EndIf Next EndFunc Link to comment Share on other sites More sharing options...
sphexion Posted April 16, 2015 Author Share Posted April 16, 2015 (edited) A full radar system can be designed. Scan center out at degrees then +1 degree scan out loop Optimal designs would be scan _PixelSearchCircumference() Followed up with scan from center out at 0, 90 , 180 ,270 degree This would be the best preforming for a movement to keep tabs on radar. Full pixel region scans will bog system calculations down, esp while rendering video. Edited April 16, 2015 by sphexion Link to comment Share on other sites More sharing options...
UEZ Posted April 17, 2015 Share Posted April 17, 2015 Somehow the function _Angle rings a bell for me... Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now