threejs雾化玻璃贴图材质效果代码

代码语言:html

所属分类:三维

代码描述:threejs雾化玻璃贴图材质效果代码

代码标签: 贴图 材质 效果

下面为部分代码预览,完整代码请点击下载或在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;
}

a {
  position: fixed;
  top: 0;
  left: 0;
  padding: 1rem;
  color: inherit;
}
</style>



</head>

<body >

  
      <script  type="module">
import * as THREE from '//cdn.skypack.dev/three@0.131.1?min';
import { OrbitControls } from '//cdn.skypack.dev/three@0.131.1/examples/jsm/controls/OrbitControls?min';

// ----
// main
// ----

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

scene.background = new THREE.Color('white');
camera.position.set(.75, .5, .65);
controls.enableDamping = true;
controls.autoRotate = true;

const light = new THREE.DirectionalLight('white', .5);
scene.add(light);
scene.add(new THREE.AmbientLight('white', .5));

// photo by Shifaaz shamoon - https://unsplash.com/photos/GIU6JpxrL84
const url0 = '//repo.bfw.wiki/bf.........完整代码请登录后点击上方下载按钮下载查看

网友评论0