unknowncheats uc-forum.com ucdownloads ucdownloads.com

Go Back   UC-Tutorials - Multiplayer Game Hacking and Cheat Tutorials > Programming > Direct3D

- Sponsored Advertisement -
http://www.myfpscheats.com/


Reply
 
Thread Tools Display Modes
  #1  
Old 11-01-2009, 10:47 AM
Dave Dave is offline
Junior Member
 
Join Date: Oct 2009
Posts: 11
Default [Code] View Matrix (Using GetTransform)

Code:
D3DXVECTOR3 EspAimbot::GetDirVector(D3DXVECTOR3 Start,D3DXVECTOR3 End)
{
	D3DXVECTOR3 VecDir,Diff;
	D3DXVec3Subtract(&Diff,&End,&Start);
	D3DXVec3Normalize(&VecDir,&Diff);
	
	return VecDir;
}

D3DXVECTOR3 EspAimbot::GetCameraVectorFromViewMatrix(LPDIRECT3DDEVICE8 pDevice)
{
	D3DXVECTOR3 Camera;
	D3DXMATRIX view;
	pDevice->GetTransform(D3DTS_VIEW, &view);
	Camera.x = -view._41;
	Camera.y = -view._42;
	Camera.z = -view._43;

	return Camera;
}

//radians
float EspAimbot::GetYawFromViewMatrix(LPDIRECT3DDEVICE8 pDevice)
{
  D3DXMATRIX view;
  float yaw;
  pDevice->GetTransform(D3DTS_VIEW,&view);
  yaw = atan2( vm._31, vm._33 );
  return yaw;
}

float EspAimbot::GetPitchFromViewMatrix(LPDIRECT3DDEVICE8 pDevice)
{
  D3DXMATRIX view;
  float pitch;
  pDevice->GetTransform(D3DTS_VIEW,&view);
  pitch = atan2(-view._32, sqrt(view._33 * view._33 + view._31 * view._31 )) ;
  return pitch;
  
}

//need to definately recheck roll :( 
float EspAimbot::GetRollFromViewMatrix(LPDIRECT3DDEVICE8 pDevice)
{
  D3DXMATRIX view;
  float roll;
  pDevice->GetTransform(D3DTS_VIEW,&view);
  roll = atan2(vm._12,vm._22);
  return roll;
 }

credits:jim adams ob sdk



NOTES: This will only work for games that use SetTransform (Battlefield series being one that doesn't)
Reply With Quote
Reply

  • Submit Thread to Digg
  • Submit Thread to del.icio.us
  • Submit Thread to StumbleUpon
  • Submit Thread to Google
  • Submit Thread to Facebook
  • Submit Thread to My Yahoo!
  • Submit Thread to MySpace
  • Submit Thread to Twitter
  • Submit Thread to Reddit

Tags
code, gettransform, matrix, view

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 02:54 PM.