Results 1 to 2 of 2
  1. #1
    Vengiance's Avatar
    Join Date
    Oct 2021
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    0

    Red face Camera matrix use for World2Screen for external cheats specifically crossfire.

    If you guys have a better way than this feel free to share it below.

    Enjoy fam

    Code:
    Base : 0x140F623D0 //Static CFPH
    
    class CameraMatrix
    {
    public:
        Vector3 LookAt; //0x0000
        char pad_000C[4]; //0x000C
        Vector3 unkvector; //0x0010
        char pad_001C[4]; //0x001C
        Vector3 Up; //0x0020
        char pad_002C[4]; //0x002C
        Vector3 Position; //0x0030
        char pad_003C[4]; //0x003C
        float fovX; //0x0040
        char pad_0044[16]; //0x0044
        float fovY; //0x0054
        char pad_0058[16]; //0x0058
        int32_t unkshit; //0x0068
        char pad_006C[12]; //0x006C
        float FovZ; //0x0078
        char pad_007C[12]; //0x007C
        int32_t screenWidth; //0x0088
        int32_t screenHeight; //0x008C
    }; //Size: 0x0090

    W2S function:
    Code:
    Vector3 WorldToScreen(Vector3 worldposition)
    {
        float yFOV = camera->fovX / camera->screenWidth * camera->screenHeight;
        D3DXVECTOR3 camToObj = { worldposition.x - camera->Position.x, worldposition.y - camera->Position.y,worldposition.z - camera->Position.z };
        float distToObj = sqrt(camToObj.x * camToObj.x + camToObj.y * camToObj.y + camToObj.z * camToObj.z);
        D3DXVec3Normalize(&camToObj, &camToObj);
    
        float camYaw = atan2f(camera->LookAt.y, camera->LookAt.x);
        float objYaw = atan2f(camToObj.y, camToObj.x);
        float relYaw = camYaw - objYaw;
    
        if (relYaw > D3DX_PI)
            relYaw -= 2 * D3DX_PI;
        if (relYaw < -D3DX_PI)
            relYaw += 2 * D3DX_PI;
    
        float objPitch = asin(camToObj.z);
        float camPitch = asin(camera->LookAt.z);
        float relPitch = camPitch - objPitch;
    
        float x = relYaw / (0.5 * camera->fovX);
        float y = relPitch / (0.5 * yFOV);
    
        x = (x + 1) / 2;
        y = (y + 1) / 2;
    
        return { x * camera->screenWidth,y * camera->screenHeight,distToObj };
    }

  2. #2
    Unknown169's Avatar
    Join Date
    Oct 2021
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by Vengiance View Post
    If you guys have a better way than this feel free to share it below.

    Enjoy fam

    Code:
    Base : 0x140F623D0 //Static CFPH
    
    class CameraMatrix
    {
    public:
        Vector3 LookAt; //0x0000
        char pad_000C[4]; //0x000C
        Vector3 unkvector; //0x0010
        char pad_001C[4]; //0x001C
        Vector3 Up; //0x0020
        char pad_002C[4]; //0x002C
        Vector3 Position; //0x0030
        char pad_003C[4]; //0x003C
        float fovX; //0x0040
        char pad_0044[16]; //0x0044
        float fovY; //0x0054
        char pad_0058[16]; //0x0058
        int32_t unkshit; //0x0068
        char pad_006C[12]; //0x006C
        float FovZ; //0x0078
        char pad_007C[12]; //0x007C
        int32_t screenWidth; //0x0088
        int32_t screenHeight; //0x008C
    }; //Size: 0x0090

    W2S function:
    Code:
    Vector3 WorldToScreen(Vector3 worldposition)
    {
        float yFOV = camera->fovX / camera->screenWidth * camera->screenHeight;
        D3DXVECTOR3 camToObj = { worldposition.x - camera->Position.x, worldposition.y - camera->Position.y,worldposition.z - camera->Position.z };
        float distToObj = sqrt(camToObj.x * camToObj.x + camToObj.y * camToObj.y + camToObj.z * camToObj.z);
        D3DXVec3Normalize(&camToObj, &camToObj);
    
        float camYaw = atan2f(camera->LookAt.y, camera->LookAt.x);
        float objYaw = atan2f(camToObj.y, camToObj.x);
        float relYaw = camYaw - objYaw;
    
        if (relYaw > D3DX_PI)
            relYaw -= 2 * D3DX_PI;
        if (relYaw < -D3DX_PI)
            relYaw += 2 * D3DX_PI;
    
        float objPitch = asin(camToObj.z);
        float camPitch = asin(camera->LookAt.z);
        float relPitch = camPitch - objPitch;
    
        float x = relYaw / (0.5 * camera->fovX);
        float y = relPitch / (0.5 * yFOV);
    
        x = (x + 1) / 2;
        y = (y + 1) / 2;
    
        return { x * camera->screenWidth,y * camera->screenHeight,distToObj };
    }
    good job , do want to cooperate to make a big external cheat? i have already done many things
    share ur D1scord or Facebook so we can communicate

Similar Threads

  1. Replies: 2
    Last Post: 11-19-2015, 12:52 AM
  2. [Info] Finding Beta Testers For My External Cheat
    By recurringlife in forum Counter Strike: Global Offensive Discussions
    Replies: 2
    Last Post: 06-25-2015, 04:00 AM
  3. Anyone get ban for use the MW3 .NET External ESP?
    By kelly232 in forum Call of Duty Modern Warfare 3 Help
    Replies: 6
    Last Post: 08-28-2012, 09:11 PM
  4. [Outdated] How to use and best settings for 'MW3 .NET External ESP v2.4 [1.7.413]' by master131
    By Plyable in forum Call of Duty Modern Warfare 3 Tutorials
    Replies: 21
    Last Post: 07-18-2012, 08:27 PM
  5. [Request] Using OllyDbg To Bypass Anti-Cheat For Soldier Of Fortune II - Fairplay.
    By leerobbo in forum General Game Hacking
    Replies: 2
    Last Post: 03-09-2012, 04:08 PM