threejs实现三维3d太阳地球月球自转和公转效果代码
代码语言:html
所属分类:三维
代码描述:threejs实现三维3d太阳地球月球自转和公转效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> html,body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,a,img,p,span,i,em,b,strong,br,hr,form,input,select,label,button,table,thead,tbody,tfoot,th,td,iframe,figure,figcaption,abbr,acronym,address,caption,cite,dfn,var,del,pre,code,caption,fieldset,legend,blockquote,details,hgroup,menu,sub,sup,ins,header,nav,aside,section,aside,footer,figure,meter,progress,time,audio,source,video,command,datalist,details,canvas,embed,hgroup,keygen,mark,output,ruby{ margin:0; padding:0; box-sizing: border-box; } html, body { width: 100%; height: 100%; background: #000 url(//repo.bfw.wiki/bfwrepo/images/skin/starry_sky_bg.jpg) no-repeat center center; overflow: hidden; } #starry-lite{ list-style: none; position: fixed; left: 0; top: 0; width: 110px; } #starry-lite li{ height: 35px; line-height: 35px; } #starry-lite li p{ display: inline-block; font-size: 14px; width: 70px; text-align: right; color: #ffffff; } #starry-lite li img{ width: 30px; height: 30px; vertical-align: middle; } .code-frame{ position: fixed; right: -800px; top: 0; width: 800px; height: 100%; background: rgba(0,0,0,0.5); transition: all 0.3s; } .code-frame.on{ right: 0; transition: all 0.3s; } .code-operate{ position: absolute; width: 32px; height: 64px; line-height: 64px; text-align: center; font-weight: bold; font-size: 24px; color: #fff; left:-32px; top:50%; margin-top: -32px; background: rgba(0,0,0,0.5); cursor: pointer; border-top-left-radius: 5px; border-bottom-left-radius: 5px; } .code-content{ width: 100%; height: 100%; overflow: auto; } #code-content{ width: 100%; height: 100%; } .code-operate:hover{ background: rgba(0,0,0,0.8); } .ace-monokai{ background-color: rgba(0,0,0,0.5) !important; } .ace-monokai .ace_gutter{ background: rgba(0,0,0,0.7) !important; } .ace_fold-widget, .ace_info, .ace_error, .ace_text-input, .ace_warning{ display: none !important; } .download-frame{ position: absolute; top: 0; left: 50%; margin-left: -80px; width: 160px; height: 50px; background: rgba(0,0,0,0.5); cursor: pointer; color: #fff; font-size: 16px; line-height: 50px; text-align: center; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; text-decoration: none; } .download-frame:hover{ background: rgba(0,0,0,0.8); color: #0268CA; } #starry-frame { width: 100%; height: 100%; } </style> <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/font-awesome-4.7.0/css/font-awesome.min.css"> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/three.126.js"></script> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/OrbitControls.126.js"></script> </head> <body> <ul id="starry-lite"> <li> <p>太阳:</p><img src="//repo.bfw.wiki/bfwrepo/images/skin/sun_min_bg.png" /></li> &.........完整代码请登录后点击上方下载按钮下载查看
网友评论0