Results 1 to 1 of 1
  1. #1
    claytonj23's Avatar
    Join Date
    Oct 2019
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    1

    Question ESP Boxes up in sky (Assault Cube C++)

    Hi, so I am making an Assault Cube ESP (with directx9) in c++. This is my first ESP so sorry if this is an obvious mistake, but I have done a lot of research and I still have no idea what's wrong. Well, I know the problem lies within my W2S function, I just don't know what I did wrong. I am going to share a screenshot of the values from the W2S function, what the ESP looks like, how I made the W2S and my ESP function. I'm not gonna include the directx9 drawing functions I used b/c I've already tested it out many times, and it draws in the correct place at all times. Thanks in advanced!


    W2S:

    Code:
    bool WorldToScreen(Vector3 pos, Vector2 &screenPos, int windowWidth, int windowHeight)
    {
    	Vector3 screenCoord;
    	screenCoord.x = pos.x * viewMatrix[0] + pos.y * viewMatrix[4] + pos.z * viewMatrix[8] + viewMatrix[12];
    	screenCoord.y = pos.x * viewMatrix[1] + pos.y * viewMatrix[5] + pos.z * viewMatrix[9] + viewMatrix[13];
    	screenCoord.w = pos.x * viewMatrix[3] + pos.y * viewMatrix[7] + pos.z * viewMatrix[11] + viewMatrix[15];
    
    	if (screenCoord.w < 0.1f)
    		return false;
    
    	Vector3 ndc;
    	ndc.x = screenCoord.x / screenCoord.w;
    	ndc.y = screenCoord.y / screenCoord.w;
    
    	screenPos.x = (windowWidth / 2 * ndc.x) + (ndc.x + windowWidth / 2);
    	screenPos.y = -(windowHeight / 2 * ndc.y) + (ndc.y + windowHeight / 2);
    
    	std::cout << "X Pos " << screenPos.x << "Y Pos " << screenPos.y << std::endl;
    
    	return true;
    }
    ESP Function:

    Code:
    void ESP(HANDLE hProc)
    {
    	// View Matrix
    	ReadProcessMemory(hProc, (BYTE*)viewMatrixAddress, &viewMatrix, sizeof(viewMatrix), NULL);
    
    	Entity entity[32];
    	Vector2 entityScreenPos[32];
    
    	std::vector<unsigned int> pos = { xPosOffset, yPosOffset, zPosOffset };
    
    	for (int i = 1; i < 32; i++)
    	{
    
    		FindEntityPos(hProc, entityList[i], pos, entity[i].position);
    
    		bool draw = WorldToScreen(entity[i].position, entityScreenPos[i], windowRect.right - windowRect.left, windowRect.bottom - windowRect.top);
    
    		if (draw == true)
    		{
    			DrawESP(entityScreenPos[i].x, entityScreenPos[i].y, 50, 100, i);
    		}
    		else
    		{
    			continue;
    		}
    	}
    }


    Attached Thumbnails Attached Thumbnails
    Shot 7.PNG  

    Screenshot (6).png  


  2. The Following User Says Thank You to claytonj23 For This Useful Post:

    avkan65 (09-17-2023)

Similar Threads

  1. Assault Cube hacks
    By Ariez in forum General Hacking
    Replies: 11
    Last Post: 02-08-2012, 12:57 AM
  2. BartJrs Assault Cube Trainer
    By bartjr in forum General Game Hacking
    Replies: 31
    Last Post: 11-04-2010, 05:28 PM
  3. Assault Cube v1.0.2 hacks?
    By Iamazn in forum General Game Hacking
    Replies: 0
    Last Post: 06-12-2009, 08:41 PM
  4. Call Of Duty 4 ESP boxes
    By poneboy00 in forum Call of Duty 4 - Modern Warfare (MW) Hacks
    Replies: 9
    Last Post: 04-30-2009, 11:23 PM
  5. Assault cube addresses
    By Blondenut1 in forum General Game Hacking
    Replies: 3
    Last Post: 04-15-2009, 06:03 PM