Hi,
I want to use an animated gif as textureMaterial for a Cube. The gif is displayed correctly but not animated.
Anyone has an idea?
animated textureMaterialSoftware: Away3D 4.x |
||
pool338, Jr. Member
Posted: 17 July 2012 08:57 AM Total Posts: 37 Hi, Anyone has an idea? |
||
|
||
Richard Olsson, Administrator
Posted: 17 July 2012 09:56 AM Total Posts: 1192 [ # 2 ] Either use separate images and replace the texture frame by frame, or better yet, render the separate frames of the GIF into a texture atlas and use UV transforms to “mask” out the right part of the atlas each frame. |
||
|
||
Richard Olsson, Administrator
Posted: 17 July 2012 10:11 AM Total Posts: 1192 [ # 4 ] Well, the easiest method then would be to use separate images. Split up your GIF into separate bitmaps, one for each frame. Either do it in Photoshop, or do it programmatically in your ActionScript code. Then create a BitmapTexture for each bitmap and store these in an array or vector, and set the material of your 3D object to a TextureMaterial. Finally, every frame, change the texture used by the texture material to the next one, effectively animating using a flip book approach. |