• Amused
  • Angry
  • Annoyed
  • Awesome
  • Bemused
  • Cocky
  • Cool
  • Crazy
  • Crying
  • Down
  • Drunk
  • Embarrased
  • Enraged
  • Friendly
  • Geeky
  • Godly
  • Happy
  • Hateful
  • Hungry
  • Innocent
  • Meh
  • Piratey
  • Poorly
  • Sad
  • Secret
  • Shy
  • Sneaky
  • Tired
  • Wtf
  • At Work
  • CodenzHub
  • Coding
  • Deejaying
  • Donating
  • Drinking
  • Eating
  • Editing
  • Hacking
  • Hate Mailing
  • Jamin'
  • Lagging
  • Live Streaming
  • Lurking
  • No Status
  • Pawning
  • PC Gaming
  • PS Gaming
  • Raging
  • Reversing
  • Sleeping
  • Steam Gaming
  • Trolling
  • TwitchStreamer
  • Vodka!
  • Watching TV/Movie
  • Xbox Gaming
  • Youtuber
  • Zombies
  • Results 1 to 7 of 7
    1. #1
      Coder
      Learning to hack games!
       
      Feeling Normal
       
      kaz's Avatar
      Join Date
      Apr 2013
      Posts
      166
      Thanks (-->)
      41
      Thanks (<--)
      49

      Alternate for external World to screen

      John Kittz
      Can this thread be moved to the correct place?


      I've seen so many threads about "WORLD TO SCREEN HARD TO FIND" after fleep released his ESP tutorial.
      This tutorial basically does an alternate using math, world to screen is not used at all in this.
      You will need aimbot angle and your view angle, so this will be really easy to implement into your aimbot if its external and writes memory.

      Get your current view and subtract it from the aimbot angle.
      float Xdif = Enemy[i].AimbotAngle[1] - ViewX;
      since your FOV is only 90 (CSS example) you will have 45 left, 45 right.
      you will have to get your window size and divide it by 90(which is the FOV)
      GetWindowRect(FindWindow(NULL, "Counter-Strike Source"), &m_Rect);
      int dx = (m_Rect.right-m_Rect.left)/90;

      pixels are only positive. so if you are aiming left of the aimbot angle then it will be negative values.
      the FOV is only 90 so we add what's half of that to the Xdif
      Xdif += 45;

      Now you have a value like 0 through 90 (the only important ones)
      0 is the very left of the screen and 90 is the very right, but this is only if your resolution is 90,90 which would be impossible to play anyways.
      So multiply Xdif * dx

      If you did all the math correctly then you should have the new x position to draw the ESP box.
      I'll use an image I'm going to wrap up in photoshop to try to make this more simple.


      Here's your FOV. Grabbing your aimbotangle-myview (example=13)
      0 is your current angle
      Click image for larger version. 

Name:	top view X.jpg 
Views:	3 
Size:	37.0 KB 
ID:	2542


      Your resolution can't get below 0 so we will add 45 which is half of the FOV
      The red line is the Aimbot angle - myview(13+45)
      Click image for larger version. 

Name:	2.jpg 
Views:	2 
Size:	43.2 KB 
ID:	2543



      since your resolution is NOT 90, 90
      we will do some math here: current resolution (eg:800) / 90
      This is 8.88888888....
      Now if you multiply 8.9 to your aimbotangle - myview (58) Then you will have the correct amount of pixels to start drawing the ESP.
      or the X value.
      Click image for larger version. 

Name:	topviewXRES.jpg 
Views:	3 
Size:	66.9 KB 
ID:	2544

      using my example to draw my ESP I have to draw 516 pixels from the left of my CSS


      repeat this process for the Y and you will have your X and Y positions for the ESP



      Credits all go to me and algebra.


      Thanks for reading!
      Last edited by kaz; 03-30-2014 at 12:36 PM.

    2. Thanks NTvalk, squeenie, Lukor, Praxeus thanked for this post
    3. #2
      Hacker
      shell toes yes
       
      Lagging
       
      squeenie's Avatar
      Join Date
      Mar 2013
      Posts
      717
      Thanks (-->)
      598
      Thanks (<--)
      221
      That's sweet as man, thanks for sharing.

    4. #3
      Newbie
      I made working aimbot lol
       
      Coding
       
      Martinek951's Avatar
      Join Date
      Dec 2012
      Location
      Czech Republic
      Posts
      29
      Thanks (-->)
      1
      Thanks (<--)
      2

      Re: Alternate for external World to screen

      I know this thread is old but hopefully. What if the player angles are not 0-360 but -infinity to +infinity. If I spin 5 times to the right, my xAng would be 3.56454 for example. Then if I spin 1 time around to the left, the ang would be 2.54648

      ------resolved-----
      -I did not realise it's radians....
      Last edited by Martinek951; 03-19-2017 at 11:38 AM.

    5. #4
      Coder
      46 75 63 6b 20 77 69 74 68 20
      6d 65 20 79 6f 75 20 6b 6e 6f
      77 20 69 20 67 6f 74 20 69 74
       
      Coding
       
      HexMurder's Avatar
      Join Date
      Oct 2014
      Posts
      187
      Thanks (-->)
      27
      Thanks (<--)
      65

      Re: Alternate for external World to screen

      Speaking of this old thread, i have always found it very interesting but i could never manage to get it to work... Anyone have a more in depth explanation on this?

    6. #5
      edgy 5 y/o
      __fastcall is superior
       
      Trolling
       
      Broihon's Avatar
      Join Date
      Jul 2015
      Location
      Gro▀deutsches Reich
      Posts
      692
      Thanks (-->)
      93
      Thanks (<--)
      252

      Re: Alternate for external World to screen

      Quote Originally Posted by HexMurder View Post
      Speaking of this old thread, i have always found it very interesting but i could never manage to get it to work... Anyone have a more in depth explanation on this?
      Problem with this is that it's simply incomplete. It won't be accurate. This is basically what's going on (sorry for shitty paint):
      Alternate for external World to screen
      d: distance to near plane in world coordinates
      a: angle between current yaw and aim angle (so a = yaw - aim_yaw)
      b: Fov angle/2
      Point P: own player/cam position (x/z coord)
      Point E: enemy position (x/z coord)
      Green Point: point on near plane where you have to draw the enemy

      The main problem with this method is that you have to know how far the near plane is away from the player camera. The near plane is basically your screen. When you know the distance from the camera to the near plane or the width of the near plane in world coordinates you can easily calculate the ScreenX coordinate using similar triangles and trigonometry.

      Edit: I might be completely wrong btw. Just saying.


      Actually it is really easier:
      Last edited by Broihon; 03-19-2017 at 06:27 PM.

    7. Thanks [GH]Rake thanked for this post
    8. #6
      Coder
      46 75 63 6b 20 77 69 74 68 20
      6d 65 20 79 6f 75 20 6b 6e 6f
      77 20 69 20 67 6f 74 20 69 74
       
      Coding
       
      HexMurder's Avatar
      Join Date
      Oct 2014
      Posts
      187
      Thanks (-->)
      27
      Thanks (<--)
      65

      Re: Alternate for external World to screen

      Quote Originally Posted by Вroihon View Post
      Actually it is really easier:
      I feel like this method would work very well for older games, but i am just misunderstanding something perhaps? The results i am getting with csgo are def wrong.
      https://i.gyazo.com/c15db0fc2f05c5dd...4167bc00f8.mp4

      The 2 in that video is being drawn with the W2S function. And the line is being drawn with this.
      I orignially wrote it like this. (very sloppy but just for testing)
      Code:
      int FOV = 90;
      
                                  float xDif = Engine.enemy[j].aimbotAngle.x - Engine.LocalPlayer.viewAngles.x;
                                  int dx = Engine.screenSize.x / FOV;
                                  xDif += FOV / 2;
                                  xDif *= dx;
      
                                  float yDif = Engine.enemy[j].aimbotAngle.y - Engine.LocalPlayer.viewAngles.y;
                                  int dy = Engine.screenSize.y / FOV;
                                  yDif += FOV / 2;
                                  yDif *= dy;
      but i was getting strange results. xDif would be between ~0 to ~1080, and yDif would be between ~0 to ~-1920. When it should be x 0 to 1920 and y 0 to 1080.

      so i did it again but this time calulated it with opposite screen coords.

      Code:
      int FOV = 90;
      
                                  float xDif = Engine.enemy[j].aimbotAngle.x - Engine.LocalPlayer.viewAngles.x;
                                  int dx = Engine.screenSize.y / FOV;
                                  xDif += FOV / 2;
                                  xDif *= dx;
      
                                  float yDif = Engine.enemy[j].aimbotAngle.y - Engine.LocalPlayer.viewAngles.y;
                                  int dy = Engine.screenSize.x / FOV;
                                  yDif += FOV / 2;
                                  yDif *= dy;
      And i also assigned them opposites as well.
      Code:
      Vec3 drawingPoint = new Vec3(1920 - yDif, xDif, 0);
      obviously there is something very wrong, because i had to do a lot of stupid things to even get this thing to half ass work. Help pls lmao.

    9. #7
      edgy 5 y/o
      __fastcall is superior
       
      Trolling
       
      Broihon's Avatar
      Join Date
      Jul 2015
      Location
      Gro▀deutsches Reich
      Posts
      692
      Thanks (-->)
      93
      Thanks (<--)
      252

      Re: Alternate for external World to screen

      Cheats'n'Trainers
      Quote Originally Posted by HexMurder View Post
      I feel like this method would work very well for older games, but i am just misunderstanding something perhaps? The results i am getting with csgo are def wrong.
      https://i.gyazo.com/c15db0fc2f05c5dd...4167bc00f8.mp4

      The 2 in that video is being drawn with the W2S function. And the line is being drawn with this.
      I orignially wrote it like this. (very sloppy but just for testing)
      Code:
      int FOV = 90;
      
                                  float xDif = Engine.enemy[j].aimbotAngle.x - Engine.LocalPlayer.viewAngles.x;
                                  int dx = Engine.screenSize.x / FOV;
                                  xDif += FOV / 2;
                                  xDif *= dx;
      
                                  float yDif = Engine.enemy[j].aimbotAngle.y - Engine.LocalPlayer.viewAngles.y;
                                  int dy = Engine.screenSize.y / FOV;
                                  yDif += FOV / 2;
                                  yDif *= dy;
      but i was getting strange results. xDif would be between ~0 to ~1080, and yDif would be between ~0 to ~-1920. When it should be x 0 to 1920 and y 0 to 1080.

      so i did it again but this time calulated it with opposite screen coords.

      Code:
      int FOV = 90;
      
                                  float xDif = Engine.enemy[j].aimbotAngle.x - Engine.LocalPlayer.viewAngles.x;
                                  int dx = Engine.screenSize.y / FOV;
                                  xDif += FOV / 2;
                                  xDif *= dx;
      
                                  float yDif = Engine.enemy[j].aimbotAngle.y - Engine.LocalPlayer.viewAngles.y;
                                  int dy = Engine.screenSize.x / FOV;
                                  yDif += FOV / 2;
                                  yDif *= dy;
      And i also assigned them opposites as well.
      Code:
      Vec3 drawingPoint = new Vec3(1920 - yDif, xDif, 0);
      obviously there is something very wrong, because i had to do a lot of stupid things to even get this thing to half ass work. Help pls lmao.
      Again, this won't work because it treats numbers as linear functions even though you're dealing with angles shit. That's why it gets to far left/right and up/down. Your code is as correct as possible with this method.
      You have to do the maths for the shitty diagram I posted if you want an FOV based w2s.

    10. Thanks HexMurder thanked for this post

    Similar Game Hacker Threads

    1. [Source Code] [OpenGL] World To Screen
      By [GH]Rake in forum Direct-X, OpenGL
      Replies: 4
      Last Post: 07-04-2015, 02:30 PM
    2. World To Screen.
      By simonpaa in forum Hacking Help
      Replies: 6
      Last Post: 01-22-2015, 03:43 PM
    3. World to screen coordinates?
      By acss in forum Hacking Help
      Replies: 6
      Last Post: 11-09-2013, 07:43 AM
    4. Please help\Tutorial World 2 Screen
      By VDV777 in forum C/C++
      Replies: 16
      Last Post: 06-12-2013, 09:37 AM

    Tags for this Thread