Guest User

Untitled

a guest
Jun 19th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. D3DXMatrixRotationX(&matRotationX,0);
  2. D3DXMatrixRotationY(&matRotationY,D3DXToRadian(fmod(clientSession.getClientChar()->getOrientation() + 0.75f, 1.0f)* 360));
  3. D3DXVECTOR3 transVec;
  4. D3DXVECTOR3 unitVec = D3DXVECTOR3(0.0f, 0.0f, -3.0f);
  5. D3DXVec3TransformCoord(&transVec, &unitVec, &matRotationY);
  6.  
  7. D3DXMatrixTranslation(&matTranslation,(vObjects[CHARACTER_OBJIDX]->getX() + transVec.x),(vObjects[CHARACTER_OBJIDX]->getY() + transVec.y),(vObjects[CHARACTER_OBJIDX]->getZ(), transVec.z));
  8. D3DXMATRIX matInverse,matTransInverse;
  9. D3DXMatrixInverse( &matInverse, NULL, &(matRotationX*matRotationY) );
  10. D3DXMatrixInverse( &matTransInverse, NULL, &(matTranslation) );
  11.  
  12. clientWindow.GetDevice()->SetTransform(D3DTS_VIEW,&(matTransInverse * matInverse));
Add Comment
Please, Sign In to add comment