# SolvedBest way to draw 2d boxes?

#### HexMurder

##### Arcane Hacker
Dank Tier VIP
Dank Tier Donator
In fleeps videos, he uses a method in which he divides ~30000/distance to obtain boxHeight and boxWidth. This method works to an extent but has many flaws.

So in cs:go i use a method that requires the players bone matrix. I get the w2s position of both head and feet position, and subtract headPos - feetPos to get boxheight. Again not flawless.

So what is the best way to do this? I see a ton of esps that definitely do NOT use either of these methods as they do not have any of the side effects that these 2 methods produce. Thanks guys.

#### JewsusChrist

##### Newbie
Full Member
You can utilize some window functions - GetWindowRect() or GetClientRect() to get the screen dimension of your targeted game.

Once you have that, you then search for your mouse coordinates ingame (X and Y)

Then you calculate your screen dimensions and your mouse coordinate to function similar to a W2S variable in a game, you're set.

After all that, just calculate your 3D coord with other entities 3D coords and do your drawings and whatnot, make sure it's within the bounds of your windows dimension and should work just like a regular ESP.

This method is universal in all games, doesn't need you to find the W2S for your targeted game at all.

Downside is that some games mouse coordinates are encrypted or function in a weird way, so you're gonna have to do the algorithm to convert them pertaining to your game.

And your ESP doesn't look that bad, nubs would die for basic esp's...... buh we're all perfectionist here aren't we?

#### Obsta

##### Jr.Hacker
Meme Tier VIP
So in cs:go i use a method that requires the players bone matrix. I get the w2s position of both head and feet position, and subtract headPos - feetPos to get boxheight. Again not flawless.
Whats flawed about it? Is the scaling on the width wrong?

#### HexMurder

##### Arcane Hacker
Dank Tier VIP
Dank Tier Donator
Whats flawed about it? Is the scaling on the width wrong?
It's flawed in several ways. The biggest of which is when trying to draw entity's near corners of the screen.

box alligned normally.

slightly distorted

and more

and more.

I'm not looking for a debate on why this is or isn't a good method. I'm just asking if there are any other methods that may work better.

#### Rake

99% of ESPs are distorted on the edges/corner of the screen I wouldn't bother trying to fix it, if you want a more precise ESP: chams + wallhack tells you where the enemies are and will never be distorted

#### Obsta

##### Jr.Hacker
Meme Tier VIP
Rake;45345 said:
99% of ESPs are distorted on the edges/corner of the screen I wouldn't bother trying to fix it, if you want a more precise ESP: chams + wallhack tells you where the enemies are and will never be distorted
To add to this, if you're persistent on staying with external, you'll be better off drawing the bones for more accuracy.

#### mambda

Escobar Tier VIP
Trump Tier Donator
to get it as perfect as you could, you'd use the model's min & max bounds, theres code for it around the internet

#### HexMurder

##### Arcane Hacker
Dank Tier VIP
Dank Tier Donator
You can utilize some window functions - GetWindowRect() or GetClientRect() to get the screen dimension of your targeted game.

Once you have that, you then search for your mouse coordinates ingame (X and Y)

Then you calculate your screen dimensions and your mouse coordinate to function similar to a W2S variable in a game, you're set.

After all that, just calculate your 3D coord with other entities 3D coords and do your drawings and whatnot, make sure it's within the bounds of your windows dimension and should work just like a regular ESP.

This method is universal in all games, doesn't need you to find the W2S for your targeted game at all.

Downside is that some games mouse coordinates are encrypted or function in a weird way, so you're gonna have to do the algorithm to convert them pertaining to your game.

And your ESP doesn't look that bad, nubs would die for basic esp's...... buh we're all perfectionist here aren't we?
Do you know what this method is called? Or where i can find more info about it? Sounds like something i would really like to try.

Attention! Before you post:

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
• 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.