Sign in to follow this  
BornToCode

Why is my texture not scrooling

Recommended Posts

BornToCode    1185
Can someone tell me why is it that after i set a translation and set the Transformation Matrix to D3DTS_TEXTURE0 and apply the translation why is my texture not moving on the Object.Any help would be appreciated thank you

Share this post


Link to post
Share on other sites
Translation of a texture goes into a different spot than translation for objects, because it's a 2D vector, not 3D. Set translation in _31, _32 of the matrix, rather than _41, _42, _43.

Also, you need to enable the transform
pDev->SetTextureStageState(D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2);

and disable it when done
pDev->SetTextureStageState(D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE);

Share this post


Link to post
Share on other sites
Tubos    211
Well, I got exactly the same problem 10 minutes ago ;)

Do you do the following when initializing?
device.SetTextureStageState(0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2)

D3DTTFF_COUNT2 means you want a 2D Texture Transformation matrix.

(I did it, and it still doesnt work).

edit: too late...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this