plnkr / feedback

Feedback on Plunker
19 stars 11 forks source link

Three.js doesn’t start rendering automatically on Plunker #566

Closed 8Observer8 closed 2 years ago

8Observer8 commented 2 years ago

Rendering starts when you move the center border: image

Try it: https://plnkr.co/edit/uIUCVLrPkzT1rHMg?preview

I described this question on Three.js forum but they said that it is Plunker bug: Three.js doesn’t start rendering automatically on Plunker

I think it is related to Fetch API. Because this version with callbacks works: https://plnkr.co/edit/tAubSKoAOWRmS02r?preview

ggoodman commented 2 years ago

Hi @8Observer8, I'm not familiar with Three.js but I notice that if I call onWindowResize() prior to calling render() at the end of init(), the scene does render. I forked your example and made this change in this plunk.

I also notice that subsequent renders work fine (either based on changes to code, manual refresh or even preview window resizing).

I'm trying to think of what might be unique about how Plunker sets up the preview iframe that could be getting in the way and am falling short.

In fact, if you run your project as a static page, the issue is also present. This makes me believe that there is some bit of initialization that is being omitted.

8Observer8 commented 2 years ago

Thank you very much!