three打造三维波浪涟漪立体方块升降动画效果代码

代码语言:html

所属分类:三维

代码描述:three打造三维波浪涟漪立体方块升降动画效果代码

代码标签: 波浪 涟漪 立体 方块 升降 动画 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">
  

  
  
<style>
canvas {
    display: block; width: 100vw; height: 100vh;
    cursor: -webkit-grab;
    cursor: grab;
}

a {
    position: fixed; top: 0; left: 0;
    padding: 5vmin;
}
</style>



</head>

<body>


  <script src='https://unpkg.co/gsap@3/dist/gsap.min.js'></script>
      <script type="module">
import * as $ from '//unpkg.com/three@0.123.0/build/three.module.js'
import { OrbitControls } from '//unpkg.com/three@0.123.0/examples/jsm/controls/OrbitControls.js'
import { EffectComposer } from '//unpkg.com/three@0.123.0/examples/jsm/postprocessing/EffectComposer'
import { RenderPass } from '//unpkg.com/three@0.123.0/examples/jsm/postprocessing/RenderPass'
import { UnrealBloomPass } from '//unpkg.com/three@0.123.0/examples/jsm/postprocessing/UnrealBloomPass'
import { BokehPass } from '//unpkg.com/three@0.123.0/examples/jsm/postprocessing/BokehPass'

// ----
// Boot
// ----

const renderer = new $.WebGLRenderer({ antialias: true });
const scene = new $.Scene();
const camera = new $.PerspectiveCamera(45, 2, .1, 1000);
const controls = new OrbitControls(camera, renderer.domElement);
const composer = new EffectComposer(renderer);
const drawingBufferSize = new $.Vector2();
window.addEventListener('resize', () => {
    const { clientWidth, clientHeight } = renderer.domElement;
    renderer.setPixelRatio(window.devicePixelRatio);
    renderer.setSize(clientWidth, clientHeight, false);
 .........完整代码请登录后点击上方下载按钮下载查看

网友评论0