
Originally Posted by
BobboHobbo
May I ask whats the difference between FindDTMRotated and DTMRotated?
DTMRotated does exactly what FindDTMRotated does, except you do not have to specify the angle. DTMRotated will keep incrementing the angle until the DTM is found or if the angle is above 'Pi / 3'. DTMRotated is in SRL whilst FindDTMRotated is in SCAR.
I'm sure the code can explain it better:
SCAR Code:
{*******************************************************************************
function DTMRotated(DTM: Integer; var x, y: Integer; x1, y1, x2, y2: Integer): Boolean;
By: Yakman
Description: First looks for a DTM without rotation, then increases the amount
of rotation around 0 gradually until it finds the DTM. A bit like the
ProgressiveTol Bitmap Engines.
*******************************************************************************}
function DTMRotated(DTM: Integer; var x, y: Integer; x1, y1, x2, y2: Integer): Boolean;
var
t, s, AngleFound: Extended;
begin
if (FindDTM(DTM, x, y, x1, y1, x2, y2)) then
begin
Result := True;
Exit;
end;
repeat
s := 0.3;
repeat
if (FindDTMRotated(DTM, x, y, x1, y1, x2, y2, 0 - t, 0 + t, s, AngleFound)) then
begin
Result := True;
Exit;
end;
s := s - 0.1;
until (s <= 0.1);
t := t + (Pi / 20);
until (t >= Pi / 3);
end;