PDA

View Full Version : how to animate a texture !?



dr death
01-07-2011, 07:55 PM
hello eveybody!
I want to move a sky's texture, as if I am a tower in the sky, but for now I do not know how to animate a texture, if you know how to post your answer! it's really urgen

The Little Body
01-07-2011, 11:30 PM
Hi,

You can move/animate texture coordinates into a spheric or 3D texture for example.

The Little Body
01-08-2011, 12:07 AM
For to animate the clouds on the sky, you can update the content of the texture on each frame or use slices in a 3D texture (where each slice can be mapped to a sphere for to have a spherical map for example)

You can find a tutorial for clouds generation on http://www.gamedev.net/reference/articles/article2085.asp

And/or use multiple textures and bind/interlace sequentially each texture one after the other (in a PAL/SECAM video, we use 25 even fields and 25 odd fields per seconds for to display a video at 50 fps)

mobeen
01-08-2011, 02:49 AM
hello eveybody!
I want to move a sky's texture, as if I am a tower in the sky, but for now I do not know how to animate a texture, if you know how to post your answer! it's really urgen
If you want to move, rotate, scale your texture then u can use the texture matrix http://www.tar.hu/gamealgorithms/app02lev1sec4.html

dr death
01-08-2011, 09:13 AM
thanks for your answers !
My idea is to fly a robot, why I want to move the sky like fate as the animation gives the impression that the robot flies! So if you can, give me the code to animat sky ! PLZ

V-man
01-09-2011, 07:16 AM
It would be something like
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glTranslatef(x, y, z);

It isn't difficult.