SRL Archive - Research & Development Lounge

How does simba get the camera degrees?


NexPB

2012-03-24 08:46:09

Title.

Harry

2012-03-24 08:56:11

You're an SRL Member and don't read the include? :/

Function rs_GetCompassAngleRadians: Extended;
var
TPA: TPointArray;
T, M: TPoint;
B: TBox;
begin
B := IntToBox(529, 9, 557, 39);
with B do
FindColorsSpiralTolerance(T.x, T.y, TPA, 65536, x1, y1, x2, y2, 0);
if Length(TPA) < 1 then
Exit;
M := MiddleBox(B);
T := MiddleTPA(TPA);
Result := ArcTan2(-(T.Y - M.Y), T.X - M.X+0.5) + Radians(90);
Result := fixRad(Result - Pi);
end;
Then just Degrees() it.

Or is there something there you don't understand?

NexPB

2012-03-24 09:44:36

From: Harry
You're an SRL Member and don't read the include? :/

Function rs_GetCompassAngleRadians: Extended;
var
TPA: TPointArray;
T, M: TPoint;
B: TBox;
begin
B := IntToBox(529, 9, 557, 39);
with B do
FindColorsSpiralTolerance(T.x, T.y, TPA, 65536, x1, y1, x2, y2, 0);
if Length(TPA) < 1 then
Exit;
M := MiddleBox(B);
T := MiddleTPA(TPA);
Result := ArcTan2(-(T.Y - M.Y), T.X - M.X+0.5) + Radians(90);
Result := fixRad(Result - Pi);
end;
Then just Degrees() it.

Or is there something there you don't understand?

Wow sorry I did but I must have overlooked it :s

Main

2012-03-24 10:50:19

But we can't get tile angle obviously:( But if we could, ooo the possibilities!

Harry

2012-03-24 10:52:32

From: NexPB
Wow sorry I did but I must have overlooked it :s

Didn't mean to sound mean. Just ctrl+click on a function next time, it'll save your life!