   Rotate a texture around an object
  I am very new to DirectX in general but I had this great idea... and can't figure it out :-)I have a cylinder with a texture on it, and I would like to rotate that texture around the object... infintely in circles if thats possible.So any ideas for a newb :-)Thanks a lot   
  You could just texture and rotate the cylinder that would give the same effect. For rotating the texture i would guess you would have to move the texture co-ords each frame by how much you want it to be rotated by. I might be wrong if someone would like to correct me. Good luck.   ;  Set the IDirect3DDevice9::SetTrasnform to D3DTS_TEXTURE0 if you want to be able to manipulate the texture instead of the object transformation. And the same way you would rotate your object is the same way you can rotate the texture around on the object. By default Direct3D has Texture Transformation disable. So to put it back on and do what you want to do you have to turn it on like so.d3ddevice->SetTextureStageState(0,D3DTSS_TEXTURETRANSFORMFLAGS,D3DTTFF_COUNT3);D3DXMATRIA16 Rotate;static float r=0;D3DXMatrixRotationY(&Rotate,D3DXToRadian(r));d3ddevice->SetTransform(D3DTS_TEXTURE0,&Rotate);r++;if(r>360)r=0;;  Actually I got it to work... Here is how much of a newb I am :-pI didn't know you could use the like transformations on single objects....I was thinking that it would screw up the mechanics and change the whole "world" and viewport and stuff.  But I simplyD3DXMatrixRotationX(&RotateTextX, .3);D3DXMatrixRotationY(&RotateTextY, (float)clock() / 1500.0f);D3DXMatrixMultiply(&TextResult, &TextResult, &RotateTextY);D3DXMatrixMultiply(&TextResult, &TextResult, &RotateTextX);as im sure... many many of you have done :-)Thanks for the help anywaysOh (if anyone is still reading) I highly doubt it makes a difference but my timeGetTime() doesn't work at all in my own programs... works great with the tutorials i downloaded(i included all the headers they did).  Instead im using clock() with time.h.Thanks again :-)   ;Quote:Original post by Thors1982Oh (if anyone is still reading) I highly doubt it makes a difference but my timeGetTime() doesn't work at all in my own programs... works great with the tutorials i downloaded(i included all the headers they did).  Instead im using clock() with time.h.Have you included the 'winmm.lib' file.   