查看效果:
下载
代码如下:
html5 canvas让地球转动起来 - 何问起 Earth() { ); stage.getWorld(); stage.getCamera(); camera.set(); camera.setResolution(); camera.setTarget()); window.onresize = function() { stage.resizeTo( ); }; window.onresize(); Clay.Collada.load( (scene) { scene.init(stage); , stage); Image(); clouds.src ; Image(); dark.src ; (){ dark.complete){ clearInterval(waiting); play(); } }, 1000); function play() { ]; shape.setMaterial(earth); ); earth.image; ; stage.addEvent((){ ttx.drawImage(base, ); ; ttx.drawImage(clouds, pos, 0); ttx.drawImage(clouds, pos); ttx.drawImage(dark, ); t += tick; x radius; z radius; y camera.set(x, y, z); }); stage.run(); } }); } window.addEventListener((){ new Earth(); }, false); html, body { width height margin padding position background .canvas3D { background position left top .earthhovertree给我一个支点,我就可以撬动地球 阿基米德给我一个HTML5浏览器,我就能转动地球 何问起首页特效原文时钟登录打火机玫瑰花3D文字太阳系Clay - A 3D engine on canvas 您的浏览器不支持canvas,请使用支持HTML5的浏览器查看本页。何问起 hovertree.com
更多: