Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Ratterbox

Direct3D - Texture Transformation Matricies

This topic is 5369 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

Would somebody be able to give me some sample code as to how to use Texture Transformation Matricies in Direct3D, obviously to change the texture coordinates effectivly?? Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
It really depends on what you want to do. What kind of change do you want to make to your texture coordinates? The code for using texture transforms is pretty much the same as any of the other transforms. You use the same D3DXMATRIX and the same functions to calculate it''s values. The only thing that changes is the first argument to SetTransform.

For example, this matrix will add 0.2 to your texture coordinates.

D3DXMATRIX matTranslate;
D3DXMatrixTranslation( &matTranslate, 0.2f, 0.2f, 0.2f );
m_pd3dDevice->SetTransform( D3DTS_TEXTURE0, &matTranslate );

neneboricua

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!