Hello every one,
Thanks you fr your help,
trying to import a mesh from blender to my scene but failed...
Here's my code :
var canvas = document.getElementById("renderCanvas");
var engine = new BABYLON.Engine(canvas, true);
var createScene = function() {
// This creates a basic Babylon Scene object (non-mesh)
var scene = new BABYLON.Scene(engine);
// The first parameter can be used to specify which mesh to import. Here we import all meshes
BABYLON.SceneLoader.ImportMesh("", "scenes/", "untitled.babylon", scene, function (newMeshes) {
// Set the target of the camera to the first imported mesh
camera.target = newMeshes[0];
});
scene.registerBeforeRender(animate);
var LinesRed = BABYLON.Mesh.CreateLines("LinesRed", [
new BABYLON.Vector3(boxRed.position.x, boxRed.position.y, boxRed.position.z),
new BABYLON.Vector3(planeRed.position.x, planeRed.position.y, planeRed.position.z),
], scene);
// Our built-in 'ground' shape. Params: name, width, depth, subdivs, scene
var ground = BABYLON.Mesh.CreateGround("ground1", 15, 15, 5, scene);
return scene;
};
var scene = createScene();
engine.runRenderLoop(function() {
scene.render();
});
// Resize
window.addEventListener("resize", function() {
engine.resize();
});
});
At first I kept my previous light, camera and so on but nothing showed up
I used the importmesh from teh playground,
it appears on sandbox
Do I have to delete the camera, light from blender and keep it on my code because i only want the mesh
Here is the browser console
Thank you all