How to create animated gif of rotating gltf model?

I want to create a gif animation of rotating gltf model. How to achieve this? What should I take into consideration?

Ideally using node.js backend but frontend solutions are also welcome.

How is it related?

Sorry, I’ve mixed your topic with another one. I’ve deleted the misleading post.

Regarding your question: It seems you can use a library like jsgif for this.

However, I’m not sure jsgif works if you pass in a 3D rendering context to its GIF encoder. You probably need a second canvas with a 2D rendering context and copy the frames from your WebGL canvas to it.