three实现三维药片胶囊效果代码
代码语言:html
所属分类:三维
代码描述:three实现三维药片胶囊效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> * { -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; margin: 0; padding: 0; } body { background: #f5b1aa; } canvas { position: fixed; width: 100%; height: 100%; top: 0; left: 0; margin: 0; padding: 0; } </style> </head> <body > <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/three.145.js"></script> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/OrbitControls.145.js"></script> <script > !function () { "use strict"; function t() { e.aspect = window.innerWidth / window.innerHeight, e.updateProjectionMatrix(), i.setSize(window.innerWidth, window.innerHeight); } let e, n, i, o, a, r, s, d, E, c; const w = 700,h = 50,l = .8,u = function () { const t = new THREE.Vector3(),e = new THREE.Euler(),n = new THREE.Quaternion(),i = new THREE.Vector3(); return function (o) { t.x = (2 * Math.random() - 1) * h, t.y = (2 * Math.random() - 1) * h, t.z = (2 * Math.random() - 1) * h, e.x = 2 * Math.random() * Math.PI, e.y = 2 * Math.random() * Math.PI, e.z = 2 * Math.random() * Math.PI, n.setFromEuler(e), i.set(1, 1, 1), o.compose(t, n, i); }; }(); !function () { const m = document.createElement("div"); document.body.appendChild(m), n = new THREE.Scene(), (i = new THREE.WebGLRenderer({ antialias: !0, alpha: !0 })). setPixelRatio(window.devicePixelRatio), i.setSize(window.innerWidth, window.innerHeight), i.outputEncodi.........完整代码请登录后点击上方下载按钮下载查看
网友评论0