I am a 3D artist, learning to code and have a beginners level understanding of javascript.
I have a Babylon scene included in my webpage.
http://stan.at/LotusFilm/SchussKanal/
(exported from maya as .babylon and used BABYLON.SceneLoader to add it to my canvas)
How can I use the buttons in my webpage to change objects in my scene? (change position/visibility of my meshes)
Im guessing it would be something like this:
button click => calls function to find object in babylon scene (by tag name?) => write new values to objects position => include in update loop
Is there a step by step guide on how to implement this?
this is my code so far:
let canvas = document.getElementById("canvas");
let engine = new BABYLON.Engine(canvas, true);
BABYLON.SceneLoader.Load("content/3D/", "scene_female_sitting_01.babylon",engine,function(myScene){
myScene.executeWhenReady(function(){
let light_01 = new BABYLON.DirectionalLight("DirectionalLight", new BABYLON.Vector3(0,-1,0),myScene);
light_01.intensity = 10;
let myCamera = new BABYLON.ArcRotateCamera("Camera",0,0,150,new BABYLON.Vector3(0,10,0),myScene);
myCamera.setPosition(new BABYLON.Vector3(0,20,-20));
myCamera.attachControl(canvas, true);
myScene.activeCamera = myCamera;
engine.runRenderLoop(function(){
myScene.render();
});
});
});