three+gsap+dat.gui实现可配置参数三维色带旋转动画效果代码
代码语言:html
所属分类:三维
代码描述:three+gsap+dat.gui实现可配置参数三维色带旋转动画效果代码
代码标签: three gsap dat.gu 配置 参数 三维 色带 旋转 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> body { margin: 0; overflow:hidden; user-select:none; } canvas { display: block; } </style> </head> <body> <script type="importmap"> { "imports": { "three": "//repo.bfw.wiki/bfwrepo/js/module/three/build/136/three.module.js", "three/addons/": "//repo.bfw.wiki/bfwrepo/js/module/three/examples/164/jsm/" } } </script> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/gsap.3.8.0.js"></script> <script type="module"> import * as THREE from 'three'; import { OrbitControls } from 'three/addons/controls/OrbitControls.js'; import { UnrealBloomPass } from 'three/addons/postprocessing/UnrealBloomPass.js'; import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js'; import { RenderPass } from 'three/addons/postprocessing/RenderPass.js'; import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js'; import { DotScreenPass } from 'three/addons/postprocessing/DotScreenPass.js'; import { GlitchPass } from 'three/addons/postprocessing/GlitchPass.js'; import { GUI } from '//repo.bfw.wiki/bfwrepo/js/module/dat.gui.js'; const scene = new THREE.Scene(); const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000); const renderer = new THREE.WebGLRenderer({ antialias: true }); renderer.setPixelRatio(window.devicePixelRatio); // renderer.setPixelRatio(window.devicePixelRatio * 1.5); renderer.setSize(window.innerWidth, window.innerHeight); document.body.appendChild(renderer.domElement); const controls = new OrbitControls(camera, renderer.domElement); controls.enableDamping = true; camera.position.set(0, 0, 40); const composer = new EffectComposer(renderer); let ribbons = []; const ribbonCount = 30; const group = new THREE.Group(); scene.add(group); let guiParams = { deformAmount: 0.1, transparency: 0.5, iridescenceIntensity: 1.0, noiseStrength: 0.2, bloomStrength: 0.5, bloomRadius: 2, bloomThreshold: 0, activateGlitc.........完整代码请登录后点击上方下载按钮下载查看
网友评论0