• Advertisement
Sign in to follow this  

translation does not work..

This topic is 2641 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


I'm trying to translate a simple triangle using the d3dx methods. The scaling and rotation seem to work but for some crazy reason the translate doesn't. here is basically what I am doing:

// create a rotation matrix
D3DXMatrixRotationY(&matRotate, D3DXToRadian(180.0f));

// create a translation matrix
D3DXMatrixTranslation(&matTrans, 10.0f, 2.0f, 0.0f);

// create a view matrix
&D3DXVECTOR3(1.5f, 0.5f, 1.5f), // the camera position
&D3DXVECTOR3(0.0f, 0.0f, 0.0f), // the look-at position
&D3DXVECTOR3(0.0f, 1.0f, 0.0f)); // the up direction

// create a projection matrix
(FLOAT)D3DXToRadian(45), // field of view
1.0f, // near view-plane
100.0f); // far view-plane

// create the final transform
matFinal = matRotate *matTrans* matView * matProjection;

devcon->UpdateSubresource(pCBuffer, 0, 0, &matFinal, 0, 0);

Edit: Nevermind I got it to work... I was going out of bounds when translating it.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement