Results 1 to 3 of 3
  1. #1
    BigPackets_Wiki's Avatar
    Join Date
    Aug 2018
    Gender
    male
    Posts
    16
    Reputation
    10
    Thanks
    1

    World To Screen is off



    my world to screen is a bit offset (to the top), im doing it in DX9 EndScene.
    anyone have a fix?

    here is my code:
    Code:
    	bool WorldScreen(const CFloat3& World, CInt2& Screen) override
    	{
    
    		CFloat3 Position = World - MW3::ViewMatrix->Origin;
    		CFloat3 Transform(Position.Dot(MW3::Refdef->ViewAxis[1]), Position.Dot(MW3::Refdef->ViewAxis[2]), Position.Dot(MW3::Refdef->ViewAxis[0]));
    		if (Transform.m_Z < 0.1f)
    			return false;
    
    		Screen.m_X = (float)MW3::Refdef->Width * 0.5f * (1 - (Transform.m_X / MW3::Refdef->FovX / Transform.m_Z));
    		Screen.m_Y = (float)MW3::Refdef->Height * 0.5f * (1 - (Transform.m_Y / MW3::Refdef->FovY / Transform.m_Z));
    		return true;
    	}
    Code:
    	MW3::ViewMatrix = (MW3::CViewMatrix*)0x01065BEC;
    	MW3::Refdef = (MW3::Refdef_t*)0x96C1B0; //0x9681B0;

  2. #2
    RichtigerSnax's Avatar
    Join Date
    Oct 2016
    Gender
    male
    Posts
    18
    Reputation
    10
    Thanks
    2
    maybe cuz of the windowed mode

  3. #3
    Walker,Johnnie Walker's Avatar
    Join Date
    Nov 2018
    Gender
    male
    Posts
    18
    Reputation
    10
    Thanks
    5

    111

    find the reason

Similar Threads

  1. [Source Code] Raidez World to Screen
    By ntKid in forum DirectX/D3D Development
    Replies: 1
    Last Post: 08-18-2012, 11:57 PM
  2. What is World To Screen?
    By u.A.v.A in forum Coders Lounge
    Replies: 3
    Last Post: 05-25-2012, 11:09 AM
  3. [Solved] How do you post in game screen shots off the website?
    By Logical. in forum CrossFire Help
    Replies: 5
    Last Post: 05-13-2012, 08:01 PM
  4. [Help Request] Screen Cut Off
    By josh29 in forum Combat Arms Help
    Replies: 10
    Last Post: 08-19-2011, 03:35 PM
  5. World 2 Screen?
    By Xlilzoosk8rX in forum Combat Arms Coding Help & Discussion
    Replies: 30
    Last Post: 10-01-2010, 12:06 PM