Jump to content
Sign in to follow this  

Finding pixel locations of an object

Recommended Posts


I am new to Arma Scripting  and I'm trying to detect an object in a *png file. This is the script I'm trying to get to work.


_screenPos = worldToScreen position pickup_truck;
_screenX = _screenPos select 0;
_screenY = _screenPos select 1;
_myX = (_screenX - safeZoneXAbs) / (safeZoneWAbs);
_myY = (_screenY - safeZoneY) / (safeZoneH);
diag_log format [ "X: %1 Y: %2", round (_myX * (getResolution select 0)), round (_myY * (getResolution select 1)) ];


Now when I look at the Image( testFile.png) at pixel location (_myX,_myY) I dont see the truck.

The truck is at around (421,612) but the output I get from the script is (619,542).


Any leads as to why this is happening will be highly appreciated.







screenshot "testFile.png";

Share this post

Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now
Sign in to follow this