Hello,
I just began to test the Babylon.js as an lightweight alternative to Unity WebGL.
I try to interact with the embedded Babylon 3D scene using (html) buttons defined and placed within html page, calling javascript functions defined in different tag than the 3D scene is created.
I am not able to get reference to the scene objects…
I try to achieve something similar to your Playground example, but there the html buttons are created from within the Babylon script tag…
Sorry for such a newbie question; I believe it has very simple solution indeed, but quite surprisingly I was not able to google the answer anywhere so far…
It is really quite simple but not always evident
So, for babylon.js <script> tag HTML page with buttons have a look at this page - Mu-so 2nd Generation 3D
There are buttons to change textures, stop camera rotation etc.
If you view source of this page - it is well commented and should be clear to understand.
It was my first page with Babylon more than 4 years ago, by the way…
Thank You all - Pryme8 , M18 and labris very much for quick and right on the spot responses → to sum up, my problem was caused by the fact that the object I tried to access was defined as local (using const) and not global (using var, such as var sphere; and define it outside of any block/function) - what a shame
Also thanks for other useful info and links!!!