jhagege
jhagege

Reputation: 1586

Render a Three.Js scene to an animated GIF file with custom intervals

I am trying to render an animated Three.js scene (basically a dynamic mesh loader that rotates the object 360 degrees automatically) to a GIF file. Basically I would like the GIF to contain frames that would be "screenshoted" from the WebGL canvas every x seconds/ms.

I have been searching for a few hours but I didn't find any good ressources on this subject.

Thanks.

Upvotes: 11

Views: 7379

Answers (2)

mrdoob
mrdoob

Reputation: 19592

Some years ago I did exactly that. You can have a look at the code here:

https://mrdoob.github.io/omggif-example/

Upvotes: 18

nkint
nkint

Reputation: 11733

I've just found this repository that seems the right one!

Quickly and easily generate looping GIFs using WebGL

Or maybe have a look at this:

A library to capture canvas-based animations

Upvotes: 4

Related Questions