javascript - Adding a button to change mesh in babylon.js -


I have a Babylonian. In JS scene, there is a terrible time to show / hide the mesh with a button. I think I can create a function which will show / hide the mashage and then the button told from my page will affect my view and the following will be written:

   

However, getting me all is an error.

  UnkeyType Error: Undefined No Function Show is Not 3D Php :: 88 onclick 3d.php :: 88  

line is 88:

  myNewScene.getMeshById (x). Visitor = 1;  

My question is, if I am declaring my Newveen as a global variable and specifying it in my visual creation then why does my browser think that this function should be there?

Thank you.

change this:

  if (BABYLON.Engine is supported ( )) {Var myNewScene = null; Var canvas = document. GetElementById ("render sheeting"); Var Engine = New Babylon. Engine (canvas, true);  

To do something like this:

  var myNewScene, canvas, engine; If (babelon.engen.is supported ()) {myNewScene = null; Canvas = document. GetElementById ("render sheeting"); Engine = new Babylon. Engine (canvas, true);  

Comments