Skip to content

Instantly share code, notes, and snippets.

@an01f01
Created January 24, 2024 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save an01f01/9f2aab998ce293b08175e67727ead2be to your computer and use it in GitHub Desktop.
Save an01f01/9f2aab998ce293b08175e67727ead2be to your computer and use it in GitHub Desktop.
{ Where AVP is the TViewport3D or self on a TForm3D }
var tmpsp: TPoint3D := ScreenHelper.CalculateScreenPosition(AVP.Context,
TPoint3D.Zero, Layer3D1.Scale.Point, Layer3D1.RotationAngle.Point, Layer3D1.Position.Point);
Circle1.Position.X := tmpsp.X - Circle1.Width / 2;
Circle1.Position.Y := tmpsp.Y - Circle1.Width / 2;
{ FIX: TPaintBox offset position }
tmpsp.X := tmpsp.X - PaintBox1.Position.X;
tmpsp.Y := tmpsp.Y - PaintBox1.Position.Y;
tmpr := RectF(tmpsp.X -FSize, tmpsp.Y -FSize, tmpsp.X +FSize, tmpsp.Y +FSize);
{ ABMP is a TBitmap }
ABMP.Canvas.FillEllipse(tmpr,100, TBrush.Create(TBrushKind.Solid,TAlphaColorRec.Aqua));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment