three打造一个旋转的木箱

代码语言:html

所属分类:三维

代码描述:three打造一个旋转的木箱

代码标签: 旋转 木箱

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

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<style>
body {
            margin: 0;
  
        }

        canvas {
            width: 100%;
            height: 100%;
         
        }
</style>

</head>
<body translate="no">
<script type="text/javascript" src="http://repo.bfw.wiki/bfwrepo/js/three.r118.js"></script>
<script>
let scene, camera, renderer, cube;

function init() {

  scene = new THREE.Scene();
  camera = new THREE.PerspectiveCamera(
  75, window.innerWidth / window.innerHeight, 0.1, 1000);



  renderer = new THREE.WebGLRenderer({
    antialias: true });


  renderer.setSize(window.innerWidth, window.innerHeight);

  document.body.appendChild(renderer.domElement);


  const geometry = new THREE.BoxGeom.........完整代码请登录后点击上方下载按钮下载查看

网友评论0