无法使用webpack和3d模型将图像加载到babylon.js中

时间:2018-09-23 03:53:41

标签: javascript webpack babylonjs

webpack和babylon.js未加载图像,视频和模型。我该如何解决?

我已经尝试这样做

BABYLON.SceneLoader.ImportMesh("him", "Dude/", "dude.babylon", scene, function (newMeshes, particleSystems, skeletons) {

newMeshes[0].position = new BABYLON.Vector3(0, 0, 5);  // The original dude
scene.beginAnimation(skeletons[0], 0, 120, 1.0, true);

dudes = [];

for (i = 0; i < 10; i++) { // 10 clones
    var xrand = Math.floor(Math.random() * 501) - 250;
    var zrand = Math.floor(Math.random() * 501) - 250;

    var c = [];

    for (j = 1; j < newMeshes.length; j++) {
        c[j] = newMeshes[j].clone("c" + j);
        c[j].position = new BABYLON.Vector3(xrand, 0, zrand);
        c[j].skeleton = newMeshes[j].skeleton.clone();
        scene.beginAnimation(c[j].skeleton, 0, 120, 1.0, true);
    }

    dudes[i] = c;
}

0 个答案:

没有答案