Toggle navigation
在线编辑器
在线代码
文本比较
jQuery下载
前端库
在线手册
登录/注册
下载代码
html
css
js
分享到微信朋友圈
X
html
css
canvas { display: block; width: 100vw; height: 100vh; } .infos { padding: 5vmin; display: grid; position: fixed; top: 0; left: 0; } .infos a { color: #eee; } body{overflow: hidden}
JavaScript
"use strict"; var Engine = BABYLON.Engine, Scene = BABYLON.Scene, ArcRotateCamera = BABYLON.ArcRotateCamera, Vector3 = BABYLON.Vector3, MeshBuilder = BABYLON.MeshBuilder, PBRMaterial = BABYLON.PBRMaterial, PointLight = BABYLON.PointLight, SolidParticleSystem = BABYLON.SolidParticleSystem, SolidParticle = BABYLON.SolidParticle, DefaultRenderingPipeline = BABYLON.DefaultRenderingPipeline; var canvas = document.querySelector('canvas'); var engine = new Engine(canvas); var scene = new Scene(engine); scene.clearColor.set(0, 0, 0, 1); var camera = new ArcRotateCamera('', -Math.PI / 2, Math.PI / 2, 10, new Vector3(0, 0, 0), scene); camera.fov = Math.PI / 2; camera.minZ = 1e-4; var light = new PointLight('', new Vector3(0, -1, 0), scene); light.intensity = 5e3; light.diffuse.set(1, 1, 1); var pp = new DefaultRenderingPipeline(''); pp.bloomEnabled = true; pp.bloomThreshold = 0.2; var mat = new PBRMaterial('', scene); mat.roughness = 1; var urnd = function (a, b) { if (a === void 0) { a = 0; } if (b === void 0) { b = 1; } return a + Math.random() * (b - a); }; var rnd = function (a, b) { if (a === void 0) { a = 0; } if (b === void 0) { b = 1; } return urnd(a, b) * (Math.random() < 0.5 ? -1 : 1); }; var box = MeshBuilder.CreatePolyhedron('', { type: 1, sizeX: 0.2, sizeY: 1, sizeZ: 0.2 }); var sps = new SolidParticleSystem('', scene); var vy = new WeakMap(); sps.addShape(box, 8e2); sps.initParticles = function () { var _a; var a = 0; for (var _i = 0, _b = sps.particles; _i < _b.length; _i++) { var p = _b[_i]; a = rnd(0, Math.PI); p.position.set(5 * Math.sin(a), urnd(-10, 100), 5 * Math.cos(a)); p.scaling.y = Math.random() * 2 + 1; (_a = p.color) === null || _a === void 0 ? void 0 : _a.set(Math.random(), Math.random(), 1, 1); vy.set(p, Math.random() * 0.1 + 0.1); } }; sps.updateParticle = function (p) { p.position.y -= vy.get(p); if (p.position.y < -10) { // passthru cam p.position.y = 100; } return p; }; sps.initParticles(); sps.buildMesh(); box.dispose(); sps.setParticles(); sps.mesh.material = mat; sps.mesh.rotation.set(Math.PI / 2, 0, 0); scene.onBeforeRenderObservable.add(function () { return sps.setParticles(); }); window.onresize = function () { return engine.resize(); }; engine.runRenderLoop(function () { return scene.render(); });
粒子
时间
文字
hover
canvas
3d
游戏
音乐
火焰
水波
轮播图
鼠标跟随
动画
css
加载动画
导航
菜单
按钮
滑块
tab
弹出层
统计图
svg
×
Close
在线代码下载提示
开通在线代码永久免费下载,需支付20jQ币
开通后,在线代码模块中所有代码可终身免费下!
您已开通在线代码永久免费下载,关闭提示框后,点下载代码可直接下载!
您已经开通过在线代码永久免费下载
对不起,您的jQ币不足!可通过发布资源 或
直接充值获取jQ币
取消
开通下载
<!doctype html> <html> <head> <meta charset="utf-8"> <title>canvas时空隧道-jq22.com</title> <script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script> <style>
</style> </head> <body>
<script>
</script>
</body> </html>
2012-2021 jQuery插件库版权所有
jquery插件
|
jq22工具库
|
网页技术
|
广告合作
|
在线反馈
|
版权声明
沪ICP备13043785号-1
浙公网安备 33041102000314号