three实现时空穿越隧道虫洞动画效果代码
代码语言:html
所属分类:三维
代码描述:three实现时空穿越隧道虫洞动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
html, body {
margin: 0;
overflow: hidden;
background-color: black;
}
.Signature {
position: absolute;
z-index: 100;
bottom: 20px;
right: 20px;
color: white;
line-height: .2;
font-size: .7em;
font-family: Open Sans, sans-serif;
}
</style>
</head>
<body>
<div id="webgl-tunnel"></div>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/jquery.3.6.0.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/three.72.js"></script>
<script>
$(function () {
var main = new Main();
$(window).resize(function () {
main.resize();
});
});
function Main()
{
// Distance travelled in the tunnel by the camera
this.cameraTravelledStep = 1;
// Camera rotation around its z-axis (moving through the tunnel)
this.cameraRotationStep = 0.0;
// Creating the renderer
this.webGLRenderer = new THREE.WebGLRenderer();
this.webGLRenderer.setSize(window.innerWidth, window.innerHeight);
$("#webgl-tunnel").append(this.webGLRenderer.domElement);
// Creating the scene
this.scene = new THREE.Scene();
.........完整代码请登录后点击上方下载按钮下载查看
网友评论0