1. 首页
  2. three.js

three.js[已解决]如何在开发人员控制台中检查示例变量?

似乎一些官方的例子现在在. How can I get a variable from inside the example into the Chome\”s developer Console?nFor example I would like to write \”scene\” into the console and inspect its value. This was possible, when the main variables were in the global scope.nExample of an example that is inside the :nhttps://threejs.org/examples/webgl_materials_cubemap_dynamic.html 13nPressing F12 in Chrome and writing \”scene\” gives an error.nJust place a breakpoint in the render loop, when your in it you can access the module scope from the console. jee7:nSeems that some official examples are now inside .nActually all of them were migrated^^. jee7:nFor example I would like to write \”scene\” into the console and inspect its value.nApart from breakpoints, the developer tools of three.js中,这是检查现场的另一种方式:Three.js开发者工具资源@jsantell最近发布了一个用于three.jsChrome网络商店的开发者。这个three.js开发者工具通过一个额外的面板来增强您的Chrome开发工具,该面板提供了各种选项,如:检查浏览器的结构/层次结构three.js场景更改三维对象、材质和,运行时的纹理或灯光检查有关图形板内存和渲染过程的统计信息(请参见WebGLRenderer.info)请注意,该工具仍在experim中…n好的,谢谢。断点似乎起作用。n该工具似乎还不太可用。对于链接的示例,它仅显示场景中的1个网格和2个BoxBufferGeometry对象,而不是立方体、结和球体。n您可以将console.log( scene )放入代码中。n但我猜您的意思是,在打开实时示例的情况下执行此操作threejs.org4,这意味着您不能编辑代码。我认为chrome控制台允许您暂停脚本并检查变量的值,而无需对代码进行任何更改。不知道该怎么做。n希望在某个时候,我们可以升级示例以允许像这样的代码编辑巴比伦是的。n当然,但是下载示例,在服务器上运行它们,更改代码的工作量太大,无法只检查单个变量。n以前我只是这样做的:控制台写入“场景”n,但现在推荐的解决方案是:n1. F12n2. 源n3. 找到渲染循环n4. 通过单击循环中的行号添加断点如果使用横向对接,观察区中的“场景”将调整面板大小,以更好地查看可变属性。这有点繁琐,但仍然可行n [SOLVED] How to inspect example variables in developer console?n

three.js[已解决]如何在开发人员控制台中检查示例变量? 为WP2原创文章,链接:https://www.wp2.cn/three-js/three-js%e5%b7%b2%e8%a7%a3%e5%86%b3%e5%a6%82%e4%bd%95%e5%9c%a8%e5%bc%80%e5%8f%91%e4%ba%ba%e5%91%98%e6%8e%a7%e5%88%b6%e5%8f%b0%e4%b8%ad%e6%a3%80%e6%9f%a5%e7%a4%ba%e4%be%8b%e5%8f%98%e9%87%8f%ef%bc%9f/