Jump to content
  • Advertisement

Archived

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

Digital Extent

Texture Transformation Matrix

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

Does anyone knows what the different element of the texture transformation matrix in D3D9 represents? I figured out a few, but what are the rest? ScaleX 12 13 14 21 ScaleY 23 24 TransX TransY 33 34 41 42 43 44 Element 12 and 21 definately affects something. Rotation? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
When using COUNT3, the entire matrix works just like any other transform matrix.

When using COUNT2 (usual for non-projected textures), the last row and column are ignored, consider the matrix to be smaller.

_11 _12 _13
_21 _22 _23
_31 _32 _33

When using 4x4 matrcies with 3 element vectors the last column is 0,0,0,1, except when doing projection. Now we''re using a 3x3 matrix with 2 element vectors... apply the "we''re not projecting rule".

_11 _12 0.0
_21 _22 0.0
_31 _32 1.0

As with normal transforms, the last row is translation.

0.0 0.0 0.0
0.0 0.0 0.0
_Tu _Tv 1.0

As with normal transforms, the scale goes in the diagonal

_Sx 0.0 0.0
0.0 _Sv 0.0
0.0 0.0 1.0

As with normal transforms, rotations occupy the space above the translations... the same space as scale. We only have one axis to rotate about in 2D

_Ra _Rb 0.0
_Rc _Rd 0.0
0.0 0.0 1.0

_Ra = cos(angle)
_Rb = sin(angle)
_Rc = -sin(angle)
_Rd = cos(angle)

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!