Hello everyone
I’am pretty new in Babylon and i have one problem. I want to change 3d model file when click button my button:
<button onclick="changeModel('prostokat.babylon')">test</button>
Function changeModel
var modelName = "kolo.babylon";
function changeModel(renameModel){
modelName = "untitled.babylon";
delayCreateScene();
}
Babylon
function delayCreateScene() {
console.log(modelName);
var scene = new BABYLON.Scene(engine);
var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0, 0, new BABYLON.Vector3(0, 0, 0), scene);
BABYLON.SceneLoader.Append("http://atma.com.pl/babylon2/", modelName, scene, function
(meshes) {
.....
}
}
If i click on the button, my function run but model is not replaced