Author Topic: Texture Animation  (Read 1783 times)

Offline ap

  • byte
  • *
  • Posts: 12
    • View Profile
Texture Animation
« 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.


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Texture Animation
« Reply #1 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)).

Offline ap

  • byte
  • *
  • Posts: 12
    • View Profile
Re: Texture Animation
« Reply #2 on: January 19, 2015, 11:13:37 am »
Thanks!
I'll give it a try.