Dad72

Gif Creation

Recommended Posts

In the documentation there is an example to create a gif animation: https://doc.babylonjs.com/how_to/render_scene_on_a_png

 var imgNm = 0;
    scene.render();
    scene.registerAfterRender(function(){
        ground.rotation.y += 1 * Math.PI / 90;
        if(imgNm++ < 90) {
            BABYLON.Tools.CreateScreenshotUsingRenderTarget(engine, camera, 200);
        }
    });

But it does not work at all. This wants to download 90 PNG images instead of a gif image.

I think the documentation lacks information here like a PG that shows how to download a Gif image

PG here: https://www.babylonjs-playground.com/#ZQ1KCR#3

Share this post


Link to post
Share on other sites

And about your issue I'm not sure if it's possible to generate a gif using javascript? In that case, documentation has to be more explicit, saying that gif isn't exported, but that you can generate image frames so as to transform them in gif with your own tools (Photoshop, Gimp, imageMagick, etc)

Share this post


Link to post
Share on other sites

Yes,  this is possible with javascript. there are several libs  including : gifshot

I have to modify the PG so that only 10 images (no 90). 😀

The documentation says we can generate gif, so I test it and it does not work.

 

Share this post


Link to post
Share on other sites

I already have what is needed.I just point out that something in the documentation is not clearly explain.What is explain, does not work, because it certainly lacks more precision to generate a gif image.  I do not ask how to do it.

Look at what is written in the documentation at the bottom of the page.

Maybe an example PG would help, because I find the information very misleading and not complete.

Share this post


Link to post
Share on other sites

Thank you but I know the address. I know Babylon since he exists. I am not a newcomer. I'm not going to multiply the reports now that I've done it here, I'm doing it on the forum by habit, and I do not want to make PR not knowing how to edit with proper English. I therefore prefer to abstain and leave those who know how to do it. 

Share this post


Link to post
Share on other sites

@Dad72 I think that your English is fine, and don' t forget that your PR will be reviewed by someone else, so your English will be corrected if needed then.
There are many people who aren' t native English speakers (including me), and still our documenting effort is worth more than no documentation  :D !

Share this post


Link to post
Share on other sites

@NodragemYou are right Nodragem. But I do not really like GitHub, so I just post things here and lets do the people that are more competent than me.

But I understand what you are saying. It's just that I'm extremely lazy sometimes, especially during the winters. 😄

I preferred the use of the Forum which suits me well and remain a user of Babylon rather than a contributor, even if I sometimes contribute and that it will surely happen again from time to time.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.