Created
November 27, 2021 00:11
-
-
Save flushpot1125/60239f810297758daf877af9f84d53e6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var experience = await scene.createDefaultXRExperienceAsync({ | |
}); | |
//1.assetManagerを宣言する | |
var assetsManager = new BABYLON.AssetsManager(scene); | |
//3.メッシュの読み込みが終わったら実行される | |
assetsManager.onFinish = function (tasks) { | |
for (var i=0;i<6;i++){ | |
//UnityのGameObject.Findと同等の処理 | |
floor[i] = scene.getMeshByName("floor_primitive"+i); | |
//ここでは読み込んだmuseum.glbから複数のメッシュを地面として指定 | |
experience.teleportation.addFloorMesh(floor[i]); | |
} | |
}; | |
//2. メッシュの読み込み処理 | |
var meshTask = assetsManager.addMeshTask("museum", "", "./model/", "museum.glb"); | |
assetsManager.load(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment