three实现三维螺旋铁丝无限延长动画效果代码
代码语言:html
所属分类:三维
代码描述:three实现三维螺旋铁丝无限延长动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
* {
margin: 0;
padding: 0;
}
#container {
width: 100vw;
height: 100vh;
}
</style>
</head>
<body translate="no">
<div id="container"></div>
<script id="vertexShader" type="x-shader/x-vertex">
uniform float time;
varying vec2 vUv;
varying vec3 vPosition;
varying vec3 vNormal;
uniform vec2 pixels;
float PI = 3.141592653589793238;
void main() {
vUv = uv;
vPosition = position;
vNormal = normal;
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}
</script>
<!-- fragment shader -->
<script id="fragmentShader" type="x-shader/x-fragment">
uniform float time;
uniform float playhead;
uniform sampler2D texture1;
uniform vec4 resolution;
uniform vec3 colors[5];
varying vec2 vUv;
varying vec3 vPosition;
varying vec3 vNormal;
float PI = 3.141592653589793238;
float aastep(float threshold, float value) {
#ifdef GL_OES_standard_derivatives
float afwidth = length(vec2(dFdx(value), dFdy(value))) * 0.70710678118654757;
return smoothstep(threshold-afwidth, th.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0