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.88.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/tween.min.js"></script>
</head>


    <script>
        var camera, glScene, glRenderer, clock;
var angle = 0,
    speedWalk = 0.1,
    speedModel = 0.005,
    amp = 10;

function createGlRenderer() {
    var b = new THREE.WebGLRenderer({
        antialias: true
    });
    b.setSize(window.innerWidth, window.innerHeight);
    b.setPixelRatio(window.devicePixelRatio);
    b.setClearColor("#222222");
    return b
}

function initialize() {
    console.log("initialize");
    camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
    camera.position.z = 100;
    glRenderer = createGlRenderer();
    document.body.appendChild(glRenderer.domElement);
    glScene = new THREE.Scene();
    var f = new THREE.BoxGeometry(20, 10, 10);
    var i = new THREE.MeshNormalMaterial();
    var g = new THREE.Object3D();
    g.name = "group";
    glScene.add(g);
    var j = new THREE.Mesh(f, i);
    j.name = "rightFoot&q.........完整代码请登录后点击上方下载按钮下载查看

网友评论0