three+EventEmitter+gsap实现三维虫洞星际之门穿越效果代码

代码语言:html

所属分类:三维

代码描述:three+EventEmitter+gsap实现三维虫洞星际之门穿越效果代码,鼠标双击大门即可进入穿越到另外一个地方,从老树干穿越到沙漠城堡只在一秒钟。

代码标签: three EventEmitter gsap 三维 虫洞 星际 之门 穿越

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

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

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


  
  
<style>
@import url(https://fonts.googleapis.com/css?family=Open+Sans:800);
.webgl {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  outline: none;
  background-color: #000000;
  cursor: move;
  width: 100%;
  height: 100%;
  /* fallback if grab cursor is unsupported */
  cursor: grab;
  cursor: -webkit-grab;
}

#credits {
  position: absolute;
  bottom: 0;
  left: 30px;
  margin-bottom: 20px;
  font-family: "Open Sans", sans-serif;
  color: #544027;
  font-size: 0.7em;
  text-transform: uppercase;
}

#credits a {
  color: #544027;
}

#credits a:hover {
  color: #d3cfcf;
}

#instructions {
  position: absolute;
  bottom: 60px;
  left: 30px;
  font-family: "Open Sans", sans-serif;
  color: #ffffff;
  font-size: 0.7em;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 1px;
}
</style>

  
  
</head>

<body translate="no">
  <canvas class="webgl"></canvas>
<div id="instructions">Drag to turn around<br />Scroll to zoom in / out<br />Click on portals to explore</div>


<script type="x-shader/x-vertex" id="vertexShader">
  precision highp float;
  varying vec2 vUv;
  void main() {
    vUv = uv;
    vec4 modelViewPosition = modelViewMatrix * vec4(position, 1.0);
    gl_Position = projectionMatrix * modelViewPosition; 
  }
</script>

<script type="x-shader/x-fragment" id="fragmentShader">
  #define PI 3.1415
  #define TAU 6.2832
  uniform sampler2D map;
  uniform sampler2D noiseMap;
  uniform float time;
  uniform float effectIntensity;
  uniform float effectMultiplier;
  varying vec2 vUv;
  
  void main() {
    
    // center uv
    ve.........完整代码请登录后点击上方下载按钮下载查看

网友评论0