three实现三维运动物体模糊拖影运动模糊动画效果代码

代码语言:html

所属分类:三维

代码描述:three实现三维运动物体模糊拖影运动模糊动画效果代码

代码标签: three 三维 运动 物体 模糊 拖影 运动 模糊 动画

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

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">

<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/three.115.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/dat.gui-min.js"></script>

<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/EffectComposer.110.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/RenderPass.110.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/ShaderPass.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/AfterimagePass.111.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/CopyShader.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/AfterimageShader.js"></script>
</head>
<body>
<script>
    var scene, camera, renderer, composer;
    var group, light;
    var effect;
    var params = {
        enable: true
    };

    // 预制件
    var Prefab = {
        Sphere: (function () {
            var instance;
            return function () {
                if (!instance) {
                    instance = new createSphere();
                }
                return instance.clone();
            }
        })()
    }

    init();
    update();
    createGUI();

    function init() {
        scene = new THREE.Scene();
        scene.fog = new THREE.Fog(0x000000, 1, 1000);

        camera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, 1, 1000);
        camera.position.z = 400;

        renderer = new THREE.WebGLRenderer();
        renderer.setPixelRatio(window.devicePixelRatio);
        renderer.setSize(window.innerWidth, window.innerHeight);
        document.body.appendChild(renderer.domElement);

        group = new THREE.Group();
        scene.add(group);

        for (var i = 0; i < 100; i++) {
            var mesh = new Pref.........完整代码请登录后点击上方下载按钮下载查看

网友评论0