It depends, where do you get the angle from, you can solve that with trigometry or vectors depending on the application.
If trig then it's something like
Code:
Const DEG_TO_RAD = PI / 180;
Angle:= * Some angle *
Reticle.X:= Plane.X + CIRCLE_RADIUS * Sin(Angle * DEG_TO_RAD);
Reticle.Y:= Plane.Y + CIRCLE_RADIUS * Sin(Angle * DEG_TO_RAD);
// Depends on api etc
Plane.DrawRotated(X,Y, Angle);
And the vector approach (using mouse for the angle)
Code:
var Direction: TVector3f;
Direction:= Vector3f(Mouse.X - Plane.X, Mouse.Y - Plane.Y);
Direction:= Normalise(Direction);
Reticle.X:= Plane.X + CIRCLE_RADIUS * Direction.X;
Reticle.Y:= Plane.Y + CIRCLE_RADIUS * Direction.Y;
Angle:= Arctan2(Direction.X, Direction.Y);
Plane.DrawRotated(X,Y, Angle);
Not tested through, but something like that
This snaps the plane to the direction, if you want smooth movements you have to interpolate the planes direction instread
Bookmarks