美文网首页
1 .了解到的知识-资源加载方式

1 .了解到的知识-资源加载方式

作者: skoll | 来源:发表于2022-09-04 22:29 被阅读0次

    promise方式-这个是加载一堆,比如一些材质

    let promise = []
    // 当前页面需要加载的全部资源
    promise.push(daggerHandleMat.loadAsync('http://127.0.0.1:8080/source/json/node4.json'))
     Promise.all(promise).then((e) => {
                   
               
         })
    

    SceneLoader

    BABYLON.SceneLoader.ImportMeshAsync("", "/relative path/", "myFile").then((result) => {
        result.meshes[1].position.x = 20;
        const myMesh1 = scene.getMeshByName("myMesh_1");
    //加载后可以修改模型
        myMesh1.rotation.y = Math.PI / 2;
    });
    

    相关文章

      网友评论

          本文标题:1 .了解到的知识-资源加载方式

          本文链接:https://www.haomeiwen.com/subject/kxlenrtx.html