jeudi 30 janvier 2014

DayZ Transformations topic




Is the current trans offset 0xE1F074?

The code is a i'm using is a modified version of this

My other question is ExplosivePimple was reading the whole player location struck into a D3DXVECTOR3 when I try to do that I end up getting incorrect values rather than reading them into individual floats x,y,z

Credits to ExplosivePimple and fatboy88

Code:



Update func

DWORD dwTransData = Read<DWORD>(dwTransformations + 0x90);
            InvViewRight = Read<D3DXVECTOR3>(dwTransData + 0x4);
            InvViewUp = Read<D3DXVECTOR3>(dwTransData + 0x10);
            InvViewForward = Read<D3DXVECTOR3>(dwTransData + 0x1C);
            InvViewTranslation = Read<D3DXVECTOR3>(dwTransData + 0x28);
            ViewPortMatrix = Read<D3DXVECTOR3>(dwTransData + 0x54);
            ProjD1 = Read<D3DXVECTOR3>(dwTransData + 0xCC);
            ProjD2 = Read<D3DXVECTOR3>(dwTransData + 0xD8);





D3DXVECTOR3 WorldToScreen(D3DXVECTOR3 in)
{
    D3DXVECTOR3 out, temp;

    D3DXVec3Subtract(&temp, &in, &InvViewTranslation);
    float x = D3DXVec3Dot(&temp, &InvViewRight);
    float y = D3DXVec3Dot(&temp, &InvViewUp);
    float z = D3DXVec3Dot(&temp, &InvViewForward);

    out.x = ViewPortMatrix.x * (1 + (x / ProjD1.x / z));
    out.y = ViewPortMatrix.y * (1 - (y / ProjD2.y / z));
    out.z = z;

    return out;
}







Aucun commentaire:

Enregistrer un commentaire