admin管理员组文章数量:1391999
I have a Three.js page that I'd like to update from r42 to r55. A fair amount of the API has changed in that time.
Some of these changes were straightforward, but now I'm stuck on some gnarly details of the JSONLoader
, for which the format has changed from JavaScript to JSON and possibly other changes are causing it to fail. An undefined
value is tripping up the API somewhere internally, and I can't tell what the issue is because the top few layers of the stack are in minified code.
What technique works best for getting the full source here? Are there source maps available?
I tried swapping the three.min.js
file for Three.js
, however the minified file contains many other files too. I don't like the idea of having to load all those files into my workspace and reference each of them just to debug a single issue for a minute.
Is there a single file that contains the non-minified equivalent of three.min.js
? Is there another approach that would work just as well?
EDIT So I'm cloning the three.js repo to get the source files, and will end up with a bunch of HTML like this:
<script type="text/javascript" src="three.js/src/Three.js"></script>
<script type="text/javascript" src="three.js/src/core/Object3D.js"></script>
<script type="text/javascript" src="three.js/src/core/Geometry.js"></script>
...
The repo is ~200MB and is taking an age to clone. There's no way to do partial clones with Git, apparently.
There has to be an easier way!
I have a Three.js page that I'd like to update from r42 to r55. A fair amount of the API has changed in that time.
Some of these changes were straightforward, but now I'm stuck on some gnarly details of the JSONLoader
, for which the format has changed from JavaScript to JSON and possibly other changes are causing it to fail. An undefined
value is tripping up the API somewhere internally, and I can't tell what the issue is because the top few layers of the stack are in minified code.
What technique works best for getting the full source here? Are there source maps available?
I tried swapping the three.min.js
file for Three.js
, however the minified file contains many other files too. I don't like the idea of having to load all those files into my workspace and reference each of them just to debug a single issue for a minute.
Is there a single file that contains the non-minified equivalent of three.min.js
? Is there another approach that would work just as well?
EDIT So I'm cloning the three.js repo to get the source files, and will end up with a bunch of HTML like this:
<script type="text/javascript" src="three.js/src/Three.js"></script>
<script type="text/javascript" src="three.js/src/core/Object3D.js"></script>
<script type="text/javascript" src="three.js/src/core/Geometry.js"></script>
...
The repo is ~200MB and is taking an age to clone. There's no way to do partial clones with Git, apparently.
There has to be an easier way!
Share Improve this question edited Feb 3, 2013 at 20:00 Drew Noakes asked Feb 3, 2013 at 19:04 Drew NoakesDrew Noakes 312k172 gold badges698 silver badges765 bronze badges2 Answers
Reset to default 3Actually that is what I do when I want to debug my code. Swap out three.min.js and put in three.js. The minified version contains the same code.
The non-minified version of the file is under version control:
https://github./mrdoob/three.js/tree/master/build
- use non-minified builds
- look at the mented out debugging points already present in three.js (i.e. console.log)
- 'use strict' if not already
- add more console.log/debugs
本文标签: javascriptTechnique for debugging ThreejsStack Overflow
版权声明:本文标题:javascript - Technique for debugging Three.js - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744693964a2620164.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论