Three.js Example code, from StackOverflow, not working

折月煮酒 提交于 2019-12-24 08:38:37

问题


I copied and pasted the Three.js code given here into an HTML file and downloaded the three.js package from the website, and configured the <script> tag to point to the location of the file three.min.js.

Nonetheless, when I open the HTML file, it displays a blank white screen.

What am I missing?


回答1:


well I tryed the exact same thing and I'm seeing the wireframe cube rotating on screen. A few things to try.

1) drop the three.min.js right in the root folder and copy/paste the example code again without any alterations.

2) did you get the three.min.js from the zip package under the build directory? Or did you navigate the git repo and copy/paste it? If copy/paste was used be sure to click the "Raw" button to get the code without the wrapper HTML.

3) try the latest Firefox or Chrome browsers first. If it works there but not in say Safari, there are a few steps you need to take to enable WebGL in Safari first.

4) your video card may be blacklisted due to driver incompatibilities.

If none of these help, then post up the code, where you got the Three.js package, what browser and video card your using and I'll see what else I can do to help :)




回答2:


I had the same problem. Windows hides the file extensions by default. I change it in folder options and it worked.



来源:https://stackoverflow.com/questions/19881735/three-js-example-code-from-stackoverflow-not-working

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!