three实现三维洞穴内部光照效果代码

代码语言:html

所属分类:三维

代码描述:three实现三维洞穴内部光照效果代码

代码标签: three 三维 洞穴 内部 光照

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

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

<head>

  <meta charset="UTF-8">
  

  
  
<style>
canvas {
  display: block;
  width: 100%;
  height: 100vh;
  cursor: -webkit-grab;
  cursor: grab;
}
</style>
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/reset.min.css">


</head>

<body >

<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/gsap.3.8.0.js"></script>
  
      <script type="module">
import * as THREE from '//repo.bfw.wiki/bfwrepo/js/module/three/build/three.module.js';
import { OrbitControls } from '//repo.bfw.wiki/bfwrepo/js/module/three/examples/jsm/controls/OrbitControls.js';


// ----
// main ( @2021-12-29 )
// ----

const renderer = new THREE.WebGLRenderer();
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(75, 2, .1, 1000);
const controls = new OrbitControls(camera, renderer.domElement);

camera.position.set(0, 0, 1);
controls.enableDamping = true;
controls.minPolarAngle = Math.PI / 2 - 0.1;
controls.maxPolarAngle = Math.PI / 2 + 0.1;
controls.minAzimuthAngle = -.2;
controls.maxAzimuthAngle = .2;
controls.maxDistance = 1;

const light = ne.........完整代码请登录后点击上方下载按钮下载查看

网友评论0