three实现三维迷幻水母游动动画效果代码

代码语言:html

所属分类:三维

代码描述:three实现三维可旋转的迷幻水母游动动画效果代码

代码标签: three 三维 水母 动画

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

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

<head>

  <meta charset="UTF-8">

  
  
  
<style>
html, body {
  margin: 0;
  overflow: hidden;
}

#canvas {
  display: block;
  width: 100vw;
  height: 100vh;
}
</style>




</head>

<body>
  <canvas id="canvas" ></canvas>

<script type="x-shader" id="shader_vertex">
#define PI 3.1415926535897932384626433832795

float TAU = PI * 2.0;

uniform float u_time;
uniform float u_width;
uniform float u_bump_frequency;
uniform float u_bump_scale;

varying vec3 v_pos;
varying vec3 v_orig_pos;
varying vec3 v_view_pos;
varying float v_bumps;

const float bump_iterations = 7.0;

void main() {

  
  vec4 model_position = modelMatrix * vec4(position, 1.0);

  vec3 pos = position;

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

网友评论0