制作3D地球仪

时间:2015-09-29 12:08:08

标签: javascript html css html5

我尝试制作像this page中的3D地球,但失败了。我对 HTML5 CSS / CSS3 没有任何了解,我只是将提供的代码粘贴到JSFiddle中,但我什么都没有。

jQuery

有人能看到我的代码有什么问题吗? 感谢。

1 个答案:

答案 0 :(得分:2)

问题是你的小提琴设置为运行onload,你设置window.onload所以代码永远不会运行,因为onload已经出现了。

在提问之前

You should debug it on your ownI've updated the fiddle以便WebGL代码实际运行。

但是,代码访问earth.jpg时遇到跨域问题。这是一个单独的问题,您可以创建一个新帖子(在您自己进行调试之后)。我首先尝试在本地服务器上运行代码,然后在本地下载映像。

  

THREE.WebGLRenderer:纹理不是两个人的力量。 Texture.minFilter   应设置为THREE.NearestFilter或THREE.LinearFilter。 https://joshcarllewis.com/static/articles/html5-3d-canvas-tutorial/earth.jpg

     

DOMException:无法执行'texImage2D'   'WebGLRenderingContext':交叉原点图像   https://joshcarllewis.com/static/articles/html5-3d-canvas-tutorial/earth.jpg   可能没有加载。(...)texImage2D @ three.js:25518uploadTexture @

相关问题