three实现三维发光圣诞树亮灯圣诞节快乐场景代码

代码语言:html

所属分类:三维

代码描述:three实现三维发光圣诞树亮灯圣诞节快乐场景代码

代码标签: three 三维 发光 圣诞树 亮灯 圣诞节 快乐

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

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

<head>

  <meta charset="UTF-8">

  
  
  
<style>
* {
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  margin: 0;
  padding: 0;
}
canvas {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  margin: 0;
  padding: 0;
}
</style>

</head>

<body >
  <!-- using three.js -->
<script type="x-shader/x-vertex" id="vertexshader">
	varying vec2 vUv;
	void main() {
		vUv = uv;
		gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
	}
</script>
<script type="x-shader/x-fragment" id="fragmentshader">
	uniform sampler2D baseTexture;
	uniform sampler2D bloomTexture;
	varying vec2 vUv;
	void main() {
		gl_FragColor = ( texture2D( baseTexture, vUv ) + vec4( 1.0 ) * texture2D( bloomTexture, vUv ) );
	}
</script>


<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/three.146.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/OrbitControls.145.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/MeshSurfaceSampler.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/EffectComposer.146.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/RenderPass.146.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/ShaderPass.146.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/UnrealBloomPass.146.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/LuminosityHighPassShader.146.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/CopyShader.146.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/FontLoader.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/TextGeometry.145.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/CurveModifier.js"></script>
      <script>
!function () {
  "use strict";
  let e,t,n,o,a,r,s,i,E,d,l,h,c = 1,w = "";
  const m = 1,R = new THREE.Layers();
  R.set(m);
  const T = {
    exposure: 2,
    bloomStrength: 2,
    bloomThreshold: 0,
    bloomRadius: 0 },
  H = new THREE.MeshBasicMaterial({
    color: "black" }),
  u = {},p = new THREE.Vector3(),M = new THREE.Matrix4();
  let g = new THREE.Vector3();
  const f = new THREE.Euler();
  let b = new THREE.Quaternion();
  const y = new THREE.Vector3(1, 1, 1),S = new THREE.Vector3(0, 0, 0);
  new THREE.Matrix4(), new THREE.Vector3(0, 1, 0);
  function x(e, n, o) {
    let a = n.length,r = new THREE.InstancedMesh(i.geometry, i.material, a);
    r.castShadow = !0, b.set(0, 0, 0, 0);
    for (let t = 0; t < a; .........完整代码请登录后点击上方下载按钮下载查看

网友评论0