Source Code How to Draw Filled Circles

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Boboo99

Scrub
Dank Tier VIP
Fleep Tier Donator
Feb 20, 2016
468
12,178
44
C++:
void DrawCirlceSplashDamage(Vector3D PositionNade, float radius, vec4_t Color)
{
	for (int i = 1; i <= 360; i++)
	{
		float ScreenPosPositionOfNade[2];
		float ScreenPositionOfRadius[2];


		float PositionNadeRadius[] = { PositionNade.x + (radius * cos(i * PI / 180)),PositionNade.y + (radius * sin(i * PI / 180)), PositionNade.z };
		float PositionOfNade[] = { PositionNade.x,PositionNade.y,PositionNade.z };
		WorldToScreen_(0x0, GetScreenMatrix_(), PositionOfNade, ScreenPosPositionOfNade);
		WorldToScreen_(0x0, GetScreenMatrix_(), PositionNadeRadius, ScreenPositionOfRadius);

		DrawLine(ScreenPosPositionOfNade[0], ScreenPosPositionOfNade[1], ScreenPositionOfRadius[0], ScreenPositionOfRadius[1], Color, RegisterShader("white"), 5);
	}
}
To draw a "filled" circle around a certain point,could be useful to draw the grenade damage radius (Thats what I did) :)

C++:
void DrawCirlceOnScreen(Vector2D Position, float radius, vec4_t Color)
{
	for (int i = 1; i <= 360; i+=10)
	{
		int x = i + 10;
		Vector2D PositionOld(Position.x + (radius * cos(i * PI / 180)), Position.y + (radius * sin(i * PI / 180)));
		Vector2D PositionNew(Position.x + (radius * cos(x * PI / 180)), Position.y + (radius * sin(x * PI / 180)));
		
		DrawLine(PositionOld.x, PositionOld.y, PositionNew.x, PositionNew.y, Color, RegisterShader("white"), 1);
	}
}
Draws a circle around a certain position on the screen,could be useful for a circle ESP(Thats what I did :D)
 

GAFO666

Hacker
Meme Tier VIP
Aug 19, 2012
520
3,188
23
If you do a filled circle, I would recommend triangles instead of lines, since it gets more performant that way and you wont get resolution problems with empty pixels :)
the theory looks like that: (well almost, Im not good in drawing ... my art teacher hated me ... :*( )

Ofc you need to apply it for the rendering engine you use :p
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods