lagauche Posted November 21, 2017 Share Posted November 21, 2017 Having more Three.js experience where the general practice is to define your variables globally at the top, I'm getting used to keeping them local when that's all I need (most Babylon.js examples seem to do this), but I'm of course unable to inspect them in the browser console to look at the topology. This is a pretty general open-ended question, but mostly I'm wondering what's the best way to still be able to inspect when using local variables? I'm more generally wondering what's the best Babylon.js practices with respect to what I'm asking. Thanks! Quote Link to comment Share on other sites More sharing options...
brianzinn Posted November 21, 2017 Share Posted November 21, 2017 There's nothing preventing you from using global variables, although it is arguably a better practice to encapsulate variables - javascript hoisting can be a hard thing to find/fix. If you need to inspect local variables you can break in the code by placing a breakpoint in the developer tools or reference from a global variable and composition. BabylonJS team has also provided two very useful tools: 1. The Inspector itself is very useful for seeing what is going on. https://doc.babylonjs.com/how_to/debug_layer 2. Spector.js even more low level down to WebGL (https://spector.babylonjs.com/) RaananW and Sebavan 2 Quote Link to comment Share on other sites More sharing options...
lagauche Posted November 24, 2017 Author Share Posted November 24, 2017 Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.