three实现老式小型飞机三维旋转效果代码

代码语言:html

所属分类:三维

代码描述:three实现老式小型飞机三维旋转效果代码

代码标签: three 老式 小型 飞机 三维 旋转

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

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

<head>
    <meta charset="UTF-8">

</head>

<body>


    <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/three.75.js"></script>

    <script>
        var width = window.innerWidth;
 var height = window.innerHeight;
 var renderer = new THREE.WebGLRenderer({
     antialias: true
 });
 renderer.setSize(width, height);
 document.body.appendChild(renderer.domElement);
 var scene = new THREE.Scene;
 var planeGroup = new THREE.Object3D();
 var bladeGroup = new THREE.Object3D();
 bladeGroup.add(planeGroup);
 scene.add(planeGroup);
 var planeMaterial = new THREE.MeshLambertMaterial({
     color: 15925002
 });
 var planeMaterialBlack = new THREE.MeshLambertMaterial({
     color: 0
 });
 var planeBody = new THREE.CylinderGeometry(0.8, 0.5, 3, 10);
 var planeTail = new THREE.CylinderGeometry(0.5, 0.1, 1.2, 10);
 var planeTailWing = new THREE.CubeGeometry(3, 0.2, 0.5);
 var planeFront = new THREE.CubeGeometry(1, 1, 1);
 var planeRotorMiddle = new THREE.SphereGeometry(0.5, 10, 1);
 var planeRotorBlade = new THREE.CubeGeometry(4, 0.2, 0.5);
 var planeRotorBlade2 = new THREE.CubeGeometry(4, 0.2, 0.5);
 var wing1 = new THREE.CubeGeometry(0.1, 1.5, 6);
 var wing2 = new THREE.CubeGeometry(0.1, 1.5, 6);
 var string = new THREE.CubeGeometry(0.2, 0.2, 1.6);
 var string1 = new THREE.CubeGeometry(0.2, 0.2, 1.6);
 var planeRotorBlade = new THREE.Mesh(planeRotorBlade, planeMaterialBlack);
 var planeRotorBlade2 = new THREE.Mesh(planeRotorBlade2, planeMaterialBlack);
 var string = new THREE.Mesh(string, planeMaterialBlack);
 var string1 = new THREE.Mesh(string1, planeMaterialBlack);
 var wing1 = new THREE.Mesh(wing1, planeMaterial);
 var wing2 = new THREE.Mesh(wing2, planeMaterial);
 var planeRotorMiddle = new THREE.Mesh(planeRotorMiddle, planeMaterial);
 var planeFront = new THREE.Mesh(planeFront, planeMaterial);
 var planeBody = new THREE.Mesh(planeBod.........完整代码请登录后点击上方下载按钮下载查看

网友评论0