www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: ap on January 19, 2015, 10:47:47 am

Title: Texture Animation
Post by: ap on January 19, 2015, 10:47:47 am
Hello

I am trying to do some texture animation - using a large texture including a grid of frames, and changing cycling through the frames by changing the texture mapping to a 3D quad.

Something like these -
https://github.com/libgdx/libgdx/wiki/2D-Animation
https://www.udacity.com/course/viewer#!/c-cs291/l-124106599/m-175393409
http://stemkoski.github.io/Three.js/Texture-Animation.html

Is it possible doing it using JPCT-AE?

Thanks
A.P.

Title: Re: Texture Animation
Post by: EgonOlsen on January 19, 2015, 10:55:21 am
Yes. You can either change the texture coordinates by using the PolygonManager (just make sure to call build(false); on them instead of build()) or, which should be simpler and faster, by using a texture matrix (http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Object3D.html#setTextureMatrix(com.threed.jpct.Matrix) (http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Object3D.html#setTextureMatrix(com.threed.jpct.Matrix))).
Title: Re: Texture Animation
Post by: ap on January 19, 2015, 11:13:37 am
Thanks!
I'll give it a try.