|
il y a 9 ans | |
---|---|---|
.. | ||
README.md | il y a 9 ans | |
babylon.glTFFileLoader.js | il y a 9 ans | |
babylon.glTFFileLoader.ts | il y a 9 ans | |
babylon.glTFFileLoaderInterfaces.js | il y a 10 ans | |
babylon.glTFFileLoaderInterfaces.ts | il y a 9 ans |
The glTF file loader is a SceneLoader plugin. Just reference the loader in your HTML file:
<script src="babylon.2.2.js"></script>
<script src="babylon.glTFFileLoader.js"></script>
And then, call the scene loader:
BABYLON.SceneLoader.Load("./", "duck.gltf", engine, function (scene) {
// do somethings with the scene
});
You can also call the ImportMesh function and import specific meshes
// meshesNames can be set to "null" to load all meshes and skeletons
BABYLON.SceneLoader.ImportMesh(["myMesh1", "myMesh2", "..."], "./", "duck.gltf", scene, function (meshes, particleSystems, skeletons) {
// do somethings with the meshes, particleSystems (not handled in glTF files) and skeletons
});