Thread: WorldToScreen

Results 1 to 6 of 6
  1. #1
    flameswor10's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    12,528
    Reputation
    981
    Thanks
    10,404
    My Mood
    In Love

    WorldToScreen

    Well, I decided that my W2S looks like it's not working.
    Can you guys confirm that it's the one making my esp not work?

    Classes:
    Code:
    class CILTDrawPrim
    {
    public:
        virtual void function0(); //
        virtual void function1(); //
        virtual void function2(); //
        virtual void function3(); //
        virtual void function4(); //
        virtual void function5(); //
        virtual void function6(); //
        virtual void function7(); //
        virtual void function8(); //
        virtual void function9(); //
        virtual void function10(); //
        virtual void function11(); //
        virtual void function12(); //
        virtual void function13(); //
        virtual void function14(); //
        virtual void function15(); //
        virtual void function16(); //
        virtual void function17(); //
        virtual void function18(); //
        virtual void function19(); //
        virtual void function20(); //
        virtual void function21(); //
        virtual void function22(); //
        virtual void function23(); //
        virtual void function24(); //
        virtual void function25(); //
        virtual void function26(); //
        virtual void function27(); //
        virtual void function28(); //
        virtual void function29(); //
        virtual void function30(); //
        virtual void function31(); //
        virtual void function32(); //
        virtual void function33(); //
        virtual void function34(); //
        virtual void function35(); //
        virtual void function36(); //
        virtual void function37(); //
        virtual void function38(); //
        virtual void function39(); //
        virtual void function40(); //
        virtual void function41(); //
        virtual void function42(); //
        virtual void function43(); //
        virtual void function44(); //
        virtual void function45(); //
        virtual void function46(); //
        virtual void function47(); //
        virtual void function48(); //
        virtual void function49(); //
        virtual HRESULT Project( float x, float y, float z, D3DXVECTOR3* pProjectOut, D3DXVECTOR3* pTransformOut); //
        char unknown[17232]; //0x0004  
        D3DXMATRIX World; //0x4354  
        D3DXMATRIX View; //0x4394  
        D3DXMATRIX Projection; //0x43D4  
    };
    W2S:
    Code:
    bool WorldToScreen(LPDIRECT3DDEVICE9 pDevice, PlayerInfo* pPlayer, D3DXVECTOR3* pScreenPos)
    {
     CILTDrawPrim* pDrawPrim = *(CILTDrawPrim**)0x8024F8 ;
    	D3DXVECTOR3 vWorld(pPlayer->obj->origin.x ,pPlayer->obj->origin.y, pPlayer->obj->origin.z);
    	D3DVIEWPORT9 viewPort = {0};
    	D3DXMATRIX projection, view, world;
    	pDevice->GetTransform(D3DTS_VIEW, &view);
    	pDevice->GetTransform(D3DTS_PROJECTION, &projection);
    	pDevice->GetTransform(D3DTS_WORLD, &world);
    	pDevice->GetViewport(&viewPort);
    	D3DXVec3Project(pScreenPos, &vWorld, &viewPort, &pDrawPrim->Projection, &pDrawPrim->View, &pDrawPrim->World);
    return( pScreenPos->z < 1.0f );
    }
    If you are kind enough, can you give me updated WorldToScreen? Thanks
    It may not be my W2s though, It may be my structs but I doubt it cause the boxes just show in a straight line, not where they should be.
    No I do not make game hacks anymore, please stop asking.


    Been MPGH Minion: 6 July 2011 - 1 August 2012

  2. #2
    wolffang0000's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Location
    here
    Posts
    597
    Reputation
    1
    Thanks
    165
    My Mood
    Relaxed
    nice man (too short)

  3. #3
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,035
    Reputation
    340
    Thanks
    2,784
    My Mood
    Sad
    Quote Originally Posted by wolffang0000 View Post
    nice man (too short)

  4. The Following 7 Users Say Thank You to freedompeace For This Useful Post:

    Cryptonic (05-15-2011),markoj (05-15-2011),NewCories (05-17-2011),pashak (05-15-2011),sanysan (07-07-2011),topblast (05-15-2011),_Fk127_ (05-15-2011)

  5. #4
    markoj's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    s
    Posts
    1,067
    Reputation
    60
    Thanks
    407
    My Mood
    Bored
    Its your WorldToScreen, I'v had that straight line problem before. THis was mine when it was working and before w/e classes changed

    Code:
    bool WorldToScreen(LPDIRECT3DDEVICE9 pDevice, PlayerInf* pPlayer, D3DXVECTOR3* Pos)
    {
    	CILTDrawPrim* pDrawPrim = *(CILTDrawPrim**)0x8024F8;
    	PlayerInf *Main = (PlayerInf*)0xPlayerInfoPointer;//Not sue what current one is
        D3DXVECTOR3 vWorld(pPlayer->obj->origin.x ,pPlayer->obj->origin.y, pPlayer->obj->origin.z);
        D3DVIEWPORT9 viewPort = {0};
       
        pDevice->GetTransform(D3DTS_VIEW, &pDrawPrim->View);
        pDevice->GetTransform(D3DTS_PROJECTION, &pDrawPrim->Projection);
        pDevice->GetTransform(D3DTS_WORLD, &pDrawPrim->World);
        pDevice->GetViewport(&viewPort);
    
        D3DXVec3Project(Pos, &vWorld, &viewPort, &pDrawPrim->Projection, &pDrawPrim->View, &pDrawPrim->World);
        
        return true;
    
    }
    Dont ban me

  6. #5
    NOOB's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Posts
    3,863
    Reputation
    425
    Thanks
    8,598
    Code:
    bool cFunctions::WorldToScreen( LPDIRECT3DDEVICE9 pDevice, D3DXVECTOR3 vWorldPos, D3DXVECTOR3 * pOut )
    {
    
    cLTClientShellBase * pClientShellBase	= (cLTClientShellBase*)(LTBase);
    CILTDrawPrim* pDrawPrim = (CILTDrawPrim*)pClientShellBase->ILTDrawPrim;
    D3DVIEWPORT9 viewPort = {0};
    pDevice->GetViewport(&viewPort);
    D3DXVec3Project( pOut, &vWorldPos, &viewPort, &pDrawPrim->Projection, &pDrawPrim->View, &pDrawPrim->World );
    
    return ( pOut->z < 1.0f );
    
    }

  7. #6
    Sydney's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Germany...
    Posts
    1,358
    Reputation
    37
    Thanks
    1,144
    My Mood
    Amused
    Its the DrawPrim class, or not. All classes from gell base got patched. Am i right?

    Thanks Cosmos