How to wait for textures to finish loading from JSON model in Three.js?

前端 未结 3 1521
说谎
说谎 2021-01-19 01:45

I have a JSON model being loaded successfully based on AlteredQualia\'s skinning example. However, I would like to not reveal the model until it is finished loading. As you

3条回答
  •  长发绾君心
    2021-01-19 02:03

    This is a ridiculously stupid cheat, but it will work as a hack. I agree one needs to realize image loading and everything else at least separately, so things that don't need images aren't twiddling their little electronic thumbs. That said, if optimization ain't your problem......

    var texture = THREE.ImageUtils.loadTexture(url); 
    while (texture.image.width == 0);

提交回复
热议问题