Je veux effectuer une translation et une rotation en même temps sur un triangle tt bete mais ca fonctionne pas. DirectX n'execute que la rotation :
// Juste la fonction qui marche pas
float posx=0.0f;
float rot=0.0f;
VOID SetupMatrices()
{
D3DXMATRIXA16 matrice;
//---------------- Translation ----------------------------
D3DXMatrixTranslation(&matrice,0,0,posx);
g_pd3dDevice->SetTransform( D3DTS_WORLD, &matrice);
posx+=0.1f;
//------------------------------------------------------------
//------------------- Rotation (y'a que ca qui marche) -----
D3DXMatrixRotationY(&matrice,D3DXToRadian(rot));
rot+=0.5f;
g_pd3dDevice->SetTransform( D3DTS_WORLD, &matrice);
//------------------------------------------------------------
// Le reste c'est pour la camera.
D3DXVECTOR3 vEyePt(0.0f, 0.0f, -5.0f );
D3DXVECTOR3 vLookatPt( 0.0f, 0.0f, 0.0f );
D3DXVECTOR3 vUpVec( 0.0f, 1.0f, 0.0f );
D3DXMATRIXA16 matView;
D3DXMatrixLookAtLH( &matView, &vEyePt, &vLookatPt, &vUpVec );
g_pd3dDevice->SetTransform( D3DTS_VIEW, &matView );
D3DXMATRIXA16 matProj;
D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI/4, 1.0f, 1.0f, 100.0f );
g_pd3dDevice->SetTransform( D3DTS_PROJECTION, &matProj );
}
Voili voilou, merci d'avance. Si je suis pas clair dites le moi surtout...