[Question] Drawing issues... again -.- menu

Shout-Out

User Tag List

Results 1 to 2 of 2
  1. #1
    -Ryuk-'s Avatar Elite User CoreCoins Purchaser Authenticator enabled
    Reputation
    529
    Join Date
    Nov 2009
    Posts
    1,028
    Thanks G/R
    38/51
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Question] Drawing issues... again -.-

    Hey guys,

    Once again, I need drawing to help me debug my bot. However I am having trouble getting it to work.

    Im struggling to updated my CameraInfo Struct...

    Code:
        public struct CameraInfo    {
            public uint unk_0;
            public int int_0;
            public Vector3 Position;
            public Matrix3 Matrix;
            public float FieldOfView;
            public uint unk_1;
            public int Timestamp;
            public float NearZ;
            public float FarZ;
            public float Aspect;
    }
    To get the "ActiveCamera" I am doing:

    Code:
    GeneralHelper.Magic.Read(GeneralHelper.Magic.Read(Offsets.Drawing.WorldFrame) +Offsets.Drawing.ActiveCamera);
    
    
    internal static uint WorldFrame = 0xC6C1E4;
    internal static uint ActiveCamera = 0x80D0;
    According to the WoWFunction GetActiveCamera, the above addresses are correct.

    Using the struct I have I get:


    The Matrix, FoV and Position seem correct, the rest are wrong.

    Any Ideas?
    |Leacher:11/2009|Donor:02/2010|Established Member:09/2010|Contributor:09/2010|Elite:08/2013|

    [Question] Drawing issues... again -.-
  2. #2
    Master674's Avatar Elite User
    Reputation
    487
    Join Date
    May 2008
    Posts
    578
    Thanks G/R
    2/23
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    inline CMatrix44 GetWorldMatrix()
    { return CMatrix44::Identity; }
    Code:
    CMatrix44 GetProjectionMatrix()
    {
    	SCameraInfo *pCamera = GetActiveCamera();
    	Delegates::CGCamera__FOV_t pGetFieldOfView = reinterpret_cast<Delegates::CGCamera__FOV_t>
    		( Process::GetVirtualMethod( (DWORD_PTR) pCamera, Offsets::VirtualMethods::Camera_FOV ) );
    
    	float fFieldOfView = pGetFieldOfView( pCamera ) * 0.6f;
    	float fNearClip = Delegates::World__GetNearClip();
    	float fFarClip = Delegates::World__GetFarClip();
    	float fAspect = Process::GetMemory<float>( Offsets::General::Camera_AspectRatio );
    	float fYScale = 1 / tanf( fFieldOfView / 2 ); // take care of division-by-zero!
    	float fXScale = fYScale / fAspect;
        
    	CMatrix44 projMatrix;
    	projMatrix.11 = fXScale;
    	projMatrix.22 = fYScale;
    	projMatrix.33 = fFarClip / ( fNearClip - fFarClip );
    	projMatrix.34 = -1.0f;
    	projMatrix.43 = fNearClip * fFarClip / ( fNearClip - fFarClip );
    	return projMatrix;
    }
    Code:
    CMatrix44 GetViewMatrix()
    {
    	SCameraInfo *pCamera = GetActiveCamera();
    	Delegates::CGCamera__Forward_t pForward = reinterpret_cast<Delegates::CGCamera__Forward_t>
    		( Process::GetVirtualMethod( (DWORD_PTR) pCamera, Offsets::VirtualMethods::Camera_Forward ) );
    
    	CVector3 vCamLookAt;
    	pForward( pCamera, &vCamLookAt );
    	vCamLookAt += pCamera->Position;
    
    	CMatrix44 viewMatrix;
    	CVector3 vZAxis = CVector3( pCamera->Position - vCamLookAt ).normalize();
    	CVector3 vXAxis = CVector3( 0, 0, 1 ).cross( vZAxis ).normalize();
    	CVector3 vYAxis = vZAxis.cross( vXAxis );
    	viewMatrix.11 = vXAxis.X; viewMatrix.12 = vYAxis.X; viewMatrix.13 = vZAxis.X;
    	viewMatrix.21 = vXAxis.Y; viewMatrix.22 = vYAxis.Y; viewMatrix.23 = vZAxis.Y;
    	viewMatrix.31 = vXAxis.Z; viewMatrix.32 = vYAxis.Z; viewMatrix.33 = vZAxis.Z;
    	viewMatrix.41 = vXAxis.dot( pCamera->Position );
    	viewMatrix.42 = vYAxis.dot( pCamera->Position );
    	viewMatrix.43 = vZAxis.dot( pCamera->Position );
    	viewMatrix.44 = 1.0f;
    	return viewMatrix;
    }
    So as you can see only position is what I get from cam struct.
    Last edited by Master674; 11-08-2012 at 10:10 AM.

Similar Threads

  1. [Question] Another Issue
    By Chenquie in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 09-24-2008, 04:37 PM
  2. [Question] Hair issues with race conversion
    By mercutius in forum WoW ME Questions and Requests
    Replies: 6
    Last Post: 04-19-2008, 01:37 PM
  3. [Question] Spell blp again
    By Pullefjun in forum WoW ME Questions and Requests
    Replies: 6
    Last Post: 11-07-2007, 12:35 PM
  4. [Question] Camera Issue with Model Editing.
    By Frombehind in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 10-12-2007, 03:57 PM
All times are GMT -5. The time now is 11:11 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search