Does CGWorldFrame::GetScreenCoordinates no longer exist in Retail? menu

User Tag List

Results 1 to 13 of 13
  1. #1
    34D's Avatar Member
    Reputation
    4
    Join Date
    May 2020
    Posts
    57
    Thanks G/R
    10/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Does CGWorldFrame::GetScreenCoordinates no longer exist in Retail?

    I matched a lot of binary files and found CGWorldFrame::GetScreenCoordinates in 6.x x64 but not found in the binary file in 9.x version,

    and NDCToDDC is only called by one function.

    If don’t have this function, only use camera?

    Does CGWorldFrame::GetScreenCoordinates no longer exist in Retail?
  2. #2
    ChrisIsMe's Avatar Contributor
    Reputation
    164
    Join Date
    Apr 2017
    Posts
    210
    Thanks G/R
    67/100
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by 34D View Post
    I matched a lot of binary files and found CGWorldFrame::GetScreenCoordinates in 6.x x64 but not found in the binary file in 9.x version,

    and NDCToDDC is only called by one function.

    If don’t have this function, only use camera?
    I use d3d and it's like 3 function calls and adapts to the games built in aspect ratio as the window size changes and all that.

    I've noticed a lot of methods are becoming inlined I do not know if this was one of them, I never cared to search for it.

  3. #3
    34D's Avatar Member
    Reputation
    4
    Join Date
    May 2020
    Posts
    57
    Thanks G/R
    10/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    At present, I have obtained the screen coordinates normally through the camera offset and the camera matrix.


    if (screenPos.x < 0 || screenPos.y < 0 || screenPos.x > rect.right || screenPos.y > rect.bottom)
    return CVector2{ 0,0 };

    If this part of the algorithm exceeds the window range, it will display 0,0
    Currently I want to return the coordinates outside the window normally

    In the game, the screen coordinates of the unit and the end coordinates of the 40 yards away from the direction of the unit are obtained.

    If the coordinates of the start point or the end point are on the screen, then the start coordinates of the cut line segment within the window will be intercepted.
    I am not very proficient in mathematics. How should this algorithm be designed? Hope someone can help

  4. #4
    hjalplos's Avatar Member
    Reputation
    6
    Join Date
    Dec 2019
    Posts
    37
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think it is still there and I've been using it like before. Offset Rebased 0x23DEA90

  5. Thanks 34D (1 members gave Thanks to hjalplos for this useful post)
  6. #5
    scimmy's Avatar Active Member
    Reputation
    52
    Join Date
    Jul 2020
    Posts
    54
    Thanks G/R
    1/33
    Trade Feedback
    0 (0%)
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by hjalplos View Post
    I think it is still there and I've been using it like before. Offset Rebased 0x23DEA90
    Are you sure that offset is correct? It leads to the middle of a function for me on 2.5.2.40045

  7. #6
    hjalplos's Avatar Member
    Reputation
    6
    Join Date
    Dec 2019
    Posts
    37
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This thread was about Retail? TBC should be: 0x1BAA030 latest update. Haven't tried it.

  8. #7
    34D's Avatar Member
    Reputation
    4
    Join Date
    May 2020
    Posts
    57
    Thanks G/R
    10/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by hjalplos View Post
    I think it is still there and I've been using it like before. Offset Rebased 0x23DEA90
    thanks. Does DDCToNDC exist? I found NDCToDDC and DDCToNDCHeight DDCToNDCWidth. But I didn’t find DDCToNDC around them.
    Last edited by 34D; 09-08-2021 at 09:21 PM.

  9. #8
    hjalplos's Avatar Member
    Reputation
    6
    Join Date
    Dec 2019
    Posts
    37
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Haven't used those. I do divide with the "fovy" and fovx" from the camera on the Vector2 from the Call to CGWorldFrame::GetScreenCoordinates. I might call those two wrong? It works with all aspects atleast.
    Code:
    float fovy;
    fovy = *(float*)(CamAddr+0x19c-4);
    float fovx;
    fovx = *(float*)(CamAddr+0x19c);
    With those two floats I do the rest in Lua in game. (X * GetScreenWidth() for example)
    But most people probably don't use LibDraw?

  10. #9
    scimmy's Avatar Active Member
    Reputation
    52
    Join Date
    Jul 2020
    Posts
    54
    Thanks G/R
    1/33
    Trade Feedback
    0 (0%)
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by hjalplos View Post
    Haven't used those. I do divide with the "fovy" and fovx" from the camera on the Vector2 from the Call to CGWorldFrame::GetScreenCoordinates. I might call those two wrong? It works with all aspects atleast.
    Code:
    float fovy;
    fovy = *(float*)(CamAddr+0x19c-4);
    float fovx;
    fovx = *(float*)(CamAddr+0x19c);
    With those two floats I do the rest in Lua in game. (X * GetScreenWidth() for example)
    But most people probably don't use LibDraw?
    Ah yes, I was talking about tbcc, not retail. What fov values/offsets would you use to get this working in tbcc? Seems like I can't just do x * screenwidth to get the correct location on my screen.

  11. #10
    hjalplos's Avatar Member
    Reputation
    6
    Join Date
    Dec 2019
    Posts
    37
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use the same offsets from Camera Address for TBC. Let's say you have your Vector2 from getscreencoords function then just divide the .X with fovx and vice versa.
    Should be good. I read the CameraBase Ptr to get the CamAddr.

  12. #11
    scimmy's Avatar Active Member
    Reputation
    52
    Join Date
    Jul 2020
    Posts
    54
    Thanks G/R
    1/33
    Trade Feedback
    0 (0%)
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by hjalplos View Post
    I use the same offsets from Camera Address for TBC. Let's say you have your Vector2 from getscreencoords function then just divide the .X with fovx and vice versa.
    Should be good. I read the CameraBase Ptr to get the CamAddr.
    huh interesting. +19c is giving me a value of 0.0f. Are you getting the camera pointer from worldframe+0x38e0?

  13. #12
    clestor's Avatar Banned
    Reputation
    3
    Join Date
    Jul 2018
    Posts
    5
    Thanks G/R
    2/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My code,convert from C++ from somewhere
    Code:
            
    public float[] WorldToScreen(float[] position)
            {
                const float deg2rad = 0.01745329251f;
                var unitPosition = new Vector3(position[0], position[1], position[2]);
                var camera = GetCamera();
                var cameraPostion = new Vector3(Memory.Read<float>(camera + 0x10), Memory.Read<float>(camera + 0x14), Memory.Read<float>(camera + 0x18));
                var diffPosition = unitPosition - cameraPostion;
                Matrix3x3 matrix = Memory.Read<Matrix3x3>(camera + 0x1C);
                float product = diffPosition.X * matrix.M11 + diffPosition.Y * matrix.M12 + diffPosition.Z * matrix.M13;
                var fov = Memory.Read<float>(camera + 0x40);
                if (product < 0) return new float[] { 0, 0 };
    
                matrix.Invert();
                var view = new Vector3(
                    matrix.M11 * diffPosition.X + matrix.M21 * diffPosition.Y + matrix.M31 * diffPosition.Z,
                    matrix.M12 * diffPosition.X + matrix.M22 * diffPosition.Y + matrix.M32 * diffPosition.Z,
                    matrix.M13 * diffPosition.X + matrix.M23 * diffPosition.Y + matrix.M33 * diffPosition.Z
                    );
                var cameraView = new Vector3(-view.Y, -view.Z, view.X);
                RECT WindowRect = new RECT();
                GetWindowRect(Memory.Process.MainWindowHandle, ref WindowRect);
                var gameScreen = new float[] { (WindowRect.Right - WindowRect.Left) / 2, (WindowRect.Bottom - WindowRect.Top) / 2 };
                var aspect = new double[] { gameScreen[0] / Math.Tan((fov * 55.0f / 2.0f) * deg2rad), gameScreen[1] / Math.Tan(((fov * 35.0f) / 2.0f) * deg2rad) };
                float[] screenPos = new float[] {
                    gameScreen[0] + cameraView.X * (float)aspect[0] / cameraView.Z,
                    gameScreen[1] + cameraView.Y * (float)aspect[1] / cameraView.Z};
                if (gameScreen[0] < 0 || gameScreen[1] < 0 || gameScreen[0] > WindowRect.Right || gameScreen[1] > WindowRect.Bottom) return new float[] { 0, 0 };
                return screenPos;
            }
    Retail&Classic share same code.(Camera struct is same)

  14. #13
    hjalplos's Avatar Member
    Reputation
    6
    Join Date
    Dec 2019
    Posts
    37
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by scimmy View Post
    huh interesting. +19c is giving me a value of 0.0f. Are you getting the camera pointer from worldframe+0x38e0?
    My CamBase Ptr is actually the same as CurrentWorldFrame Ptr so I might have mixed things up. still should work for you too. So try the +19c from the current world frame instead.

Similar Threads

  1. Replies: 3
    Last Post: 05-18-2020, 10:17 AM
  2. [Selling] Initiate's Shirt. Moggable in legion. no longer available in-game. 250k gold.
    By res in forum World of Warcraft Buy Sell Trade
    Replies: 0
    Last Post: 01-16-2016, 08:31 PM
  3. Does the Model no longer exist?
    By Reddaddy in forum WoW ME Questions and Requests
    Replies: 4
    Last Post: 05-21-2011, 09:36 PM
  4. TCG Scam No Longer Avaivible in 3.2
    By Nikentic in forum WoW Scam Prevention
    Replies: 10
    Last Post: 08-09-2009, 11:02 PM
  5. Wallrunning no longer working in PTR?
    By garymce in forum World of Warcraft General
    Replies: 2
    Last Post: 08-07-2006, 08:40 PM
All times are GMT -5. The time now is 01:28 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search