threejs加载gltf小岛灯塔房屋三维模型效果代码

代码语言:html

所属分类:三维

代码描述:threejs加载gltf小岛灯塔房屋三维模型效果代码

代码标签: threejs gltf 小岛 灯塔 房屋 三维 模型

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

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

<head>

    <meta charset="UTF-8">


    <style>
        @import url("https://fonts.googleapis.com/css2?family=Comfortaa:wght@700&display=swap");
        body {
          width: 100vw;
          height: 100vh;
          margin: 0;
          overflow: hidden;
          font-family: "Comfortaa", cursive;
        }
        
        .link {
          position: fixed;
          bottom: 0;
          left: 0;
          right: 0;
          padding: 5px 0 10px;
          text-align: center;
          font-size: 16px;
          color: #fff;
          text-decoration: none;
        }
        .link_svg {
          position: relative;
          top: 5px;
          margin: 0 3px;
        }
    </style>


</head>

<body>

<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/three.108.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/OrbitControls.108.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/GLTFLoader.108.js"></script>
    <script>
        var scene = new THREE.Scene();
        scene.background = new THREE.Color(0x092241);
        
        var camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 1, 1000);
        camera.position.set(1, 1, 3.5);
        
        var renderer = new THREE.WebGLRenderer({ antialias: true });
        renderer.setSize(window.innerWidth, window.innerHeight);
        document.body.appendChild(renderer.domElement);
        
        var controls = new THREE.OrbitControls(camera).........完整代码请登录后点击上方下载按钮下载查看

网友评论0