three实现炫酷三维音乐盒播放动画效果代码
代码语言:html
所属分类:三维
代码描述:three实现炫酷三维音乐盒播放动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
body{
overflow: hidden;
margin: 0;
}
</style>
</head>
<body translate="no">
<!--script async src="https://ga.jspm.io/npm:es-module-shims@1.5.1/dist/es-module-shims.js" crossorigin="anonymous"></script-->
<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/three@0.148.0/build/three.module.js",
"three/addons/": "https://unpkg.com/three@0.148.0/examples/jsm/"
}
}
</script>
<script type="module">
import * as THREE from "three";
import {OrbitControls} from "three/addons/controls/OrbitControls.js";
import {mergeBufferGeometries} from "three/addons/utils/BufferGeometryUtils.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 { UnrealBloomPass } from 'three/addons/postprocessing/UnrealBloomPass.js';
console.clear();
class Postprocessing {
constructor(scene, camera, renderer) {
const renderScene = new RenderPass(scene, camera);
const bloomPass = new UnrealBloomPass(
new THREE.Vector2(window.innerWidth, window.innerHeight),
1.25,
0.25,
0
);
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0