Maybe you might want to have a look at the Source SDK? I don't know.
Hi
I have the x,y,z coordinates and the pitch/yaw of my player entity. Same with the enemy players. I tried to find out their screen location via World2Screen.
This is my function
It kind of works but the 2d coordinates are absolutely not correct. I will post some screenshots l8r.Code:D3DXVECTOR3 *World2Screen(LPDIRECT3DDEVICE9 pDevice, D3DXVECTOR3 &vScreenCoord, D3DXVECTOR3 vEnemy) { if( !pDevice ) return NULL; D3DXMATRIX matProj; float fAspect = (float)(1280) / 720; D3DXMatrixPerspectiveFovRH(&matProj, (float)(D3DX_PI/180*90), fAspect, 0.1, -1); float *pX = (float*)(*(DWORD*)(Base)+0x60); float *pY = (float*)(*(DWORD*)(Base)+0x68); float *pZ = (float*)(*(DWORD*)(Base)+0x64); float *pitch = (float*)(*(DWORD*)(Base)+0x6C); float *yaw = (float*)(*(DWORD*)(Base)+0x70); D3DXVECTOR3 vEye ( *pX, *pY, *pZ); D3DXVECTOR3 vTarget ( *pX + *yaw, *pY + (*pitch * -1), *pZ); D3DXVECTOR3 vUp ( 0, 0, 1 ); D3DXMATRIX matView; D3DXMatrixLookAtRH( &matView, &vEye, &vTarget, &vUp); D3DVIEWPORT9 viewPort; D3DXMATRIX identity; pDevice->GetViewport( &viewPort ); D3DXMatrixIdentity( &identity ); D3DXVec3Project(&vScreenCoord, &vEnemy, &viewPort, &matProj, &matView, &identity ); if(vScreenCoord.z < 1) return &vScreenCoord; return NULL; }
[img]https://img7.imagebanan*****m/img/z4bk0r00/fu1.png[/img]
[img]https://img6.imagebanan*****m/img/l03mfttv/fu2.png[/img]
Last edited by Arnibold; 09-06-2011 at 12:53 AM.
Maybe you might want to have a look at the Source SDK? I don't know.
Donate:
BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9
Handy Tools/Hacks:
Extreme Injector v3.7.3
A powerful and advanced injector in a simple GUI.
Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!
Minion Since: 13th January 2011
Moderator Since: 6th May 2011
Global Moderator Since: 29th April 2012
Super User/Unknown Since: 23rd July 2013
'Game Hacking' Team Since: 30th July 2013
--My Art--
[Roxas - Pixel Art, WIP]
[Natsu - Drawn]
[Natsu - Coloured]
All drawings are coloured using Photoshop.
--Gifts--
[Kyle]
Seeing CS brings back such good memories. I think imma play it again just this night
I'm SCHiM
Morals derive from the instinct to survive. Moral behavior is survival behavior above the individual level.
Polymorphic engine
Interprocess callback class
SIN
Infinite-precision arithmetic
Hooking dynamic linkage
(sloppy)Kernel mode Disassembler!!!
Semi debugger
@Arnibold I would like to see the whole project source. I can add some hacks if you want also?
Also, it looks like the 2D - Y is right, but the X is off?
Last edited by kibbles18; 09-07-2011 at 07:17 PM.
perhaps you need to use the left-handed functions instead of right-handed?
D3DXMatrixLookAtLH Function (Windows)
D3DXMatrixPerspectiveFovLH Function (Windows)
Sorry for the late response,
I used the engine anyhow.
Result:
[img]https://img7.imagebanan*****m/img/6mdvjpg3/asdaaa.jpg[/img]
(missing HUD and darkish screen is cuz of screenshot hotkey f10)
Try scaling from 800x600 to 1280x720
New X & Y would become 578, 280, which would be right above the 2nd player from the left.
Ah we-a blaze the fyah, make it bun dem!