three实现立体方块数字时钟效果代码

代码语言:html

所属分类:三维

代码描述:three实现立体方块数字时钟效果代码

代码标签: three 立体 方块 数字 时钟

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

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

<head>

    <meta charset="UTF-8">





    <style>
        body{
          margin:0;
          padding:0;
          border:0;
          overflow:hidden;
        }
    </style>



</head>



    <body>



<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/three.84.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/TweenMax.min.js"></script>
    <script >
        window.addEventListener("resize", resize);
        
        var scene;
        var camera;
        var renderer;
        var time = [];
        
        var list = [];
        list[0] = [];
        list[1] = [];
        list[2] = [];
        list[3] = [];
        list[4] = [];
        list[5] = [];
        list[0]["offset"] = 0;
        list[1]["offset"] = 6;
        list[2]["offset"] = 14;
        list[3]["offset"] = 20;
        list[4]["offset"] = 28;
        list[5]["offset"] = 34;
        
        var offset;
        var numbers = [[
        [1, 1, 1],
        [1, 0, 1],
        [1, 0, 1],
        [1, 0, 1],
        [1, 1, 1]],
        [
        [0, 0, 1],
        [0, 1, 1],
        [0, 0, 1],
        [0, 0, 1],
        [0, 0, 1]],
        [
        [1, 1, 1],
        [0, 0, 1],
        [1, 1, 1],
        [1, 0, 0],
        [1, 1, 1]],
        [
        [1, 1, 1],
        [0, 0, 1],
        [1, 1, 1],
        [0, 0, 1],
        [1, 1, 1]],
        [
        [1, 0, 1],
        [1, 0, 1],
        [1, 1, 1],
        [0, 0, 1],
        [0, 0, 1]],
        [
        [1, 1, 1],
        [1, 0, 0],
        [1, 1, 1],
        [0, 0, 1],
        [1, 1, 1]],
        [
        [1, 1, 1],
        [1, 0, 0],
        [1, 1, 1],
        [1, 0, 1],
        [1, 1, 1]],
        [
        [1, 1, 1],
        [0, 0, 1],
        [0, 0, 1],
        [0, 0, 1],
        [0, 0, 1]],
        [
        [1, 1, 1],
        [1, 0, 1],
        [1, 1, 1],
        [1, 0, 1],
        [1, 1, 1]],
        [
        [1, 1, 1],
        [1, 0, 1],
        [1, 1, 1],
        [0, 0, 1],
        [1, 1, 1]]];
        
        
        init();
        
        
        function resize() {
          document.body.innerHTML = "";
          init();
        }
        
        function init() {
        
          document.querySelector("body").innerHTML = "";
          scene = new THREE.Scene();
          var aspect = window.innerWidth / window.innerHeight;
          camera = new THREE.PerspectiveCamera(20, aspect, 0.1, 1000);
          renderer = new THREE.WebGLRenderer({ antialias: true });
          renderer.setSize(window.innerWidth, window.innerHeight);
          document.body.appendChild(renderer.domElement);
          camera.position.z = 70;
          camera.position.y = -5;
          camera.position.x = -15;
          camera.rotation.y = THREE.Math.degToRad(0);
          light1 = new THREE.DirectionalLight(0xffffff, 1);
          light1.position.set(-150, 80, 80);
          light2 = new THREE.AmbientLight(0xffffff, 0.5);
          var geometry = new THREE.PlaneGeometry(1000, 1000, 1, 1);
          var material = new.........完整代码请登录后点击上方下载按钮下载查看

网友评论0