Hello,
I’m still a newbie in Babylon.js and guess that I’m missing something here. Maybe you can help me.
I’m trying to import meshes that I’ve created in Blender into a Babylon.js scene, in either .glb or .gltf format. In the Babylon.js sandbox they are displayed perfectly and all materials and textures show up in the scene explorer. So I assume the mesh export from Blender was well.
However, when I try to load the mesh into my scene, it appears completely black. Here’s the code that I use for loading:
BABYLON.SceneLoader.ImportMeshAsync(“Central Pool”, “models/”, “The-Persian-Garden_CentralPool.gltf”, scene).then((result) => {
var centralPool = result.meshes[0]; centralPool.position.x = 0; centralPool.position.z = 0; centralPool.position.y = 0; }
I hope I have included the correct Babylon.js files. Here are the respective lines from the header:
<script src="https://cdn.babylonjs.com/babylon.js"></script>
<script src="https://cdn.babylonjs.com/loaders/babylon.glTFFileLoader.js"></script>
<script src="https://cdn.babylonjs.com/loaders/babylonjs.loaders.js"></script>
<script src="https://cdn.babylonjs.com/materialsLibrary/babylonjs.materials.js"></script>
The strange thing is that when I zoom on the mesh, I see vague lines ot tiling, like from the materials that I’ve applied. So after all could it have something to do with the light? The mesh seems not to reflecting any light from the central light source.
Maybe you have some hints for me. Many thanks in advance!
Hayden