three实现三维大屁股电脑中的温馨小房间代码

代码语言:html

所属分类:三维

代码描述:three实现三维大屁股电脑中的温馨小房间代码

代码标签: three 三维 大屁股 电脑 温馨 房间 代码

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

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

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


  
  
<style>
*,
*::after,
*::before {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  outline: none;
  font-family: monospace;
}

body {
  overflow: hidden;
  background-color: #d2cfc8;
  cursor: grab;
}

.webgl,
#loader {
  position: fixed;
  top: 0;
  left: 0;
}

#loader {
  display: grid;
  place-content: center;
  width: 100%;
  height: 100%;
  background-color: #FAEDCD;
}
</style>



  
  
</head>

<body translate="no">
  <canvas class="webgl"></canvas>
<div id="loader">
    <h1>Loading</h1>
</div>

<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/three.124.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/GLTFLoader.128.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/OrbitControls.126.js"></script>
  
      <script >
const loading = document.querySelector('#loader');

const canvas = document.querySelector('.webgl');
const scene = new THREE.Scene();
const textureLoader = new THREE.TextureLoader();
const sizes = {
  width: window.innerWidth,
  height: window.innerHeight };


// Base camera
const camera = new THREE.PerspectiveCamera(10, sizes.width / sizes.height, 0.1, 100);
camera.position.x = 8;
camera.position.y = 4;
camera.position.z = 15;
scene.add(camera);

//Controls
const controls = new THREE.OrbitControls(camera, canvas);
controls.enableDamping = true;
controls.enableZoom = true;
controls.enablePan .........完整代码请登录后点击上方下载按钮下载查看

网友评论0