Advertisement Jump to content
Sign in to follow this  
REspawn

UV Animation

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

Hi, I'm just google'n tutorials and UV Animation, anyone got any links or tips? I am thinking of Locking the models data, changing thw UV cords and unlocking, anyone got a better way of doing it? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
If you want the UV-coordinates to follow a complicated path defined in an external text file you'll probably need to alter the contents of the vertex buffer every frame. If it's a simple linear or circular motion I'd say do it directly in the vertex shader.

Share this post


Link to post
Share on other sites
If it can be done by a matrix, you can just set a texture transformation matrix.

I found a sample here, just omit the line setting the TEXCOORDINDEX to CAMERASPACEPOSITION.

You can make your 2D transformation with D3DXMatrixTransformation2D, set it, enable it, draw, then remember to disable it after by setting the transform flags back to D3DTTFF_DISABLE.

If you're using a shader, rather than the fixed pipe, just add another matrix variable, set it from code, and multiply your UVs by it in the vertex shader.

Share this post


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

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!