World 2 Screen in BFA menu

User Tag List

Results 1 to 5 of 5
  1. #1
    WiNiFiX's Avatar Banned
    Reputation
    242
    Join Date
    Jun 2008
    Posts
    447
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    World 2 Screen in BFA

    Hi all,
    Does anyone know the new struct for BFA for CGCamera? as my one for Vanilla in the below code no longer works

    Code:
        public static class Camera
        {
            public static ProcessSharp ProcessSharp { get; private set; }
    
    
            public static int CameraOffset { get; } = 0x3330;
    
    
            internal static IntPtr BaseAddress
            {
                get
                {
                    var ptr = ProcessSharp.Memory.Read<IntPtr>(Offsets.CameraBase);
                    return ProcessSharp.Memory.Read<IntPtr>(ptr + CameraOffset);
                }
            }
    
    
            [StructLayout(LayoutKind.Sequential)]
            public unsafe struct CGCamera
            {
                private readonly IntPtr vTable;     // 0x0
                private readonly int unk0;          // 0x4
                public Vector3 Position;            // 0x8
                private fixed float Facing[9];      // 0x14 (3x3 Matrix)
                public readonly float NearClip;     // 0x38
                public readonly float FarClip;      // 0x3C
                public readonly float FieldOfView;  // 0x40
                public readonly float Aspect;       // 0x44
            }
    
    
            private static CGCamera cam => ProcessSharp.Memory.Read<CGCamera>(BaseAddress);
            public static float X => cam.Position.X;
            public static float Y => cam.Position.Y;
            public static float Z => cam.Position.Z;
            public static float FOV => cam.FieldOfView;
            public static float NearClip => cam.NearClip;
            public static float FarClip => cam.FarClip;
            public static float Aspect => cam.Aspect;
    
    
            private static Matrix Matrix
            {
                get
                {
                    var bCamera = ProcessSharp.Memory.Read(BaseAddress + 0x1C, 36);  // was 0x14 not 0x1C in 1.12.1
                    var m = new Matrix();
                    m[0, 0] = BitConverter.ToSingle(bCamera, 0);
                    m[0, 1] = BitConverter.ToSingle(bCamera, 4);
                    m[0, 2] = BitConverter.ToSingle(bCamera, 8);
                    m[1, 0] = BitConverter.ToSingle(bCamera, 12);
                    m[1, 1] = BitConverter.ToSingle(bCamera, 16);
                    m[1, 2] = BitConverter.ToSingle(bCamera, 20);
                    m[2, 0] = BitConverter.ToSingle(bCamera, 24);
                    m[2, 1] = BitConverter.ToSingle(bCamera, 28);
                    m[2, 2] = BitConverter.ToSingle(bCamera, 32);
    
    
                    return m;
                }
            }
    
    
            public static Vector2 WorldToScreen(float x, float y, float z)
            {
                var Projection = Matrix.PerspectiveFovRH(FOV * 0.5f, Aspect, NearClip, FarClip);
    
    
                var eye = new Vector3(X, Y, Z);
                var lookAt = new Vector3(X + Matrix[0, 0], Y + Matrix[0, 1], Z + Matrix[0, 2]);
                var up = new Vector3(0f, 0f, 1f);
    
    
                var View = Matrix.LookAtRH(eye, lookAt, up);
                var World = Matrix.Identity;
    
    
                var WorldPosition = new Vector3(x, y, z);
    
    
                var ScreenPosition = Vector3.Project(WorldPosition, 0f, 0f, WindowHelper.WindowWidth, WindowHelper.WindowHeight, NearClip, FarClip, World * View * Projection);
                return new Vector2(ScreenPosition.X, ScreenPosition.Y - 20f);
            }
    
    
            public static void Initialize(ProcessSharp processSharp)
            {
                ProcessSharp = processSharp;
                WindowHelper.Initialize(processSharp);
    
    
                Log.Write("Camera Ready", Color.Green);
                Log.Write($"Camera Base 0x{BaseAddress.ToString("X")}");
                Log.Write($"FOV          = {FOV}");
                Log.Write($"Aspect       = {Aspect}");
                Log.Write($"NearClip     = {NearClip}");
                Log.Write($"FarClip      = {FarClip}");
                Log.Write($"Camera X     = {X}");
                Log.Write($"Camera Y     = {Y}");
                Log.Write($"Camera Z     = {Z}");
                Log.Write($"Matrix[0, 0] = {Matrix[0, 0]}");
                Log.Write($"Matrix[0, 1] = {Matrix[0, 1]}");
                Log.Write($"Matrix[0, 2] = {Matrix[0, 2]}");
                Log.Write($"WindowWidth  = {WindowHelper.WindowWidth}");
                Log.Write($"WindowHeight = {WindowHelper.WindowHeight}");
            }
       }

    World 2 Screen in BFA
  2. #2
    Sychotix's Avatar Moderator Authenticator enabled
    Reputation
    1421
    Join Date
    Apr 2006
    Posts
    3,942
    Thanks G/R
    285/572
    Trade Feedback
    1 (100%)
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Check https://www.ownedcore.com/forums/wor...ml#post3879642 ([Wow] [8.0.1.27219])

    I use these offsets. Obviously the camera base needs updating.

  3. #3
    WiNiFiX's Avatar Banned
    Reputation
    242
    Join Date
    Jun 2008
    Posts
    447
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Sychotix View Post
    Check https://www.ownedcore.com/forums/wor...ml#post3879642 ([Wow] [8.0.1.27219])


    I use these offsets. Obviously the camera base needs updating.

    Thanks I saw those CameraBase is a pattern
    Code:
    CameraBase = GetAddressFromPattern("48 8B 0D ?? ?? ?? ?? 48 8B 74 24 48 48", 3, 4);
    but can't figure out how to get some values like Aspect?

    Code:
    Details         Hex    Dec
    CameraOriginX : 0x10 = 16
    CameraOriginY : 0x14 = 20
    CameraOriginZ : 0x18 = 24
    CameraMatrix  : 0x1C = 28
    CameraFov     : 0x40 = 64
    CameraAspect  : ?
    Last edited by WiNiFiX; 08-28-2018 at 09:32 AM.

  4. #4
    Sychotix's Avatar Moderator Authenticator enabled
    Reputation
    1421
    Join Date
    Apr 2006
    Posts
    3,942
    Thanks G/R
    285/572
    Trade Feedback
    1 (100%)
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by WiNiFiX View Post
    Thanks I saw those CameraBase is a pattern
    Code:
    CameraBase = GetAddressFromPattern("48 8B 0D ?? ?? ?? ?? 48 8B 74 24 48 48", 3, 4);
    but can't figure out how to get some values like Aspect?

    Code:
    Details         Hex    Dec
    CameraOriginX : 0x10 = 16
    CameraOriginY : 0x14 = 20
    CameraOriginZ : 0x18 = 24
    CameraMatrix  : 0x1C = 28
    CameraFov     : 0x40 = 64
    CameraAspect  : ?
    Well, based off the original offsets you posted, aspect was 4 bytes after FoV. I'd assume its 0x44 still, but worst case... you know the aspect ratio of your screen.

  5. #5
    WiNiFiX's Avatar Banned
    Reputation
    242
    Join Date
    Jun 2008
    Posts
    447
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Sychotix View Post
    Well, based off the original offsets you posted, aspect was 4 bytes after FoV. I'd assume its 0x44 still, but worst case... you know the aspect ratio of your screen.
    Edit: after lots of fiddling I got most reading correctly - but now I have 3 unknowns NearClip, FarClip and Aspect, anyone got methods to find those?

    Code:
    Camera Base 0x17126FD0E40
    Camera vTable = 7FF787242D78
    Camera X      = -895.1711
    Camera Y      = 4344.633
    Camera Z      = 766.7753
    Matrix[0, 0]  = -0.598479
    Matrix[0, 1]  = -0.2134038
    Matrix[0, 2]  = -0.7721928
    Matrix[1, 0]  = 0.3358636
    Matrix[1, 1]  = -0.9419107
    Matrix[1, 2]  = 0
    Matrix[2, 0]  = -0.7273366
    Matrix[2, 1]  = -0.2593514
    Matrix[2, 2]  = 0.635388
    NearClip      = ?
    FarClip       = ?
    FOV           = 1.570796
    Aspect        = 5.170791E-43 ?
    WindowWidth   = 2560
    WindowHeight  = 1080
    Code:
            public unsafe struct CGCamera
            {
                public readonly IntPtr vTable;     // 0x0
                public readonly int unk0;          // 0x4
                public readonly int unk1;          // 0x8
                public Vector3 Position;           // 0x10
                public fixed float Facing[9];      // 0x14 (3x3 Matrix)            
                public readonly float FieldOfView; // 0x40
                public readonly float Aspect;      // 0x44
            }
    Last edited by WiNiFiX; 08-28-2018 at 11:28 AM.

Similar Threads

  1. [Selling] Azerite Power ★ Flying in BFA ★ Gearing 430 ★ Manapearls Farm
    By Boosthive in forum World of Warcraft Buy Sell Trade
    Replies: 10
    Last Post: 03-29-2018, 12:34 PM
  2. [World Building] Karazhan in Elwynn Forest! (Download!)
    By Xel in forum WoW Advanced Model Edits
    Replies: 21
    Last Post: 11-03-2009, 12:49 AM
  3. [PICS] ULTIMATE World of Warcraft in BETA / ALPHA testing stage thread
    By Snapple in forum World of Warcraft Exploration
    Replies: 18
    Last Post: 06-23-2009, 03:04 PM
  4. [World Edit]Karazhan in Goldshire
    By Shady200 in forum World of Warcraft Model Editing
    Replies: 14
    Last Post: 04-14-2008, 02:58 PM
  5. Warcraft three screens in WoW possible
    By kody_ in forum World of Warcraft General
    Replies: 10
    Last Post: 08-11-2007, 11:00 PM
All times are GMT -5. The time now is 04:35 PM. 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