XIMRX

Members
  • Content Count

    3
  • Joined

  • Last visited

Posts posted by XIMRX


  1. We can render a scene in Babylon.JS reading values like position/scale from form fields. But does it allow to make changes in scene listening real time changes in input fields like $('input').val()

    var cusotm_position = $('input').val();
    canvas = document.getElementById("renderCanvas");
    engine = new BABYLON.Engine(canvas, true);
    scene = createScene(); //draws a mesh at custom_position 
    engine.runRenderLoop(function () {
        scene.render();
    });
    
    
    $("input").change(function(){
        cusotm_position = $('input').val();
        delete scene;scene = createScene(); //hangs website for few seconds,need its alternate
    });

    I tried to call scene.render();  on event listener of change in input but that doesn't seem to be doing anything. Is there anything like refrest/update to change to updated variable values. Better if this can be done without removing everything and recreating fresh scene. As delete scene;scene = createScene(); does refresh everything with new variable values but it hangs the website for few seconds.