Giter VIP home page Giter VIP logo

Comments (4)

binita12345 avatar binita12345 commented on July 22, 2024

https://www.opengl.org/discussion_boards/showthread.php/198512-How-make-an-animated-texture-%28OpenGL-DevIL-C-%29

You can't load a single animated texture like this.

What you do is load each frame as a separate texture, then animate it as time passes.

For example, if your .gif had 10 frames, you would load create 10 separate textures and load each frame into each texture. Then, if you wished to animate them at 10 fps, you check the amount of time that has passed. If 0 to 0.1 seconds has passed you display frame 0, if 0.1 to 0.2 seconds has passed you display frame 1, and so on.

Any Demo is available for above solution ?

from awe.js.

awe-media avatar awe-media commented on July 22, 2024

Feel free to provide a pull request if you'd like to submit some code. Otherwise this is not a bug - this is a feature request so closing.

from awe.js.

awe-media avatar awe-media commented on July 22, 2024

NOTE: You can also use the projection.update() api to update the texture periodically too. e.g.

var butterfly = awe.projections.view(PROJECTION_ID_HERE);
var i = 1;
b.update({
  position:{ y:1 }, // use a minimal non-zero update here
  animation:{
    duration:0.2, // 5 animation steps are 1/5th of a second
    repeat:5, // play for 1 second total
    persist:0,
    step_callback:function() { 
      i++; if (i>5) { i = 1; } // add time scaling here if the animation is too fast
      b.update({ texture:{ path:i+'.png' } });
    }
  }
});

from awe.js.

binita12345 avatar binita12345 commented on July 22, 2024

thanks for your reply
but i have to trigger update function periodically in my app,
how is it possible? how to trigger that function periodically?
if you have any solution, give me soon reply.

from awe.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.