splinecode三维圆盘小球伸缩转动效果代码

代码语言:html

所属分类:三维

代码描述:splinecode三维圆盘小球伸缩转动效果代码

代码标签: splinecode 三维 圆盘 小球 伸缩 转动

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

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

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


  
  
<style>
body {
  background-color: #eddfd4;
  margin: 0;
  overflow: hidden;
}

#container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: 100% !important;
}
#canvas3d {
  width: 100% !important;
  height: 100% !important;
}
</style>


  
  
</head>

<body translate="no">
  <canvas id="canvas3d"></canvas>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/gsap.3.12.2.js"></script>
<script  type="module">
const fileName = "kxGDa-Zy1Dp4t5B7";

function r2d(r) {
  return r * (180 / Math.PI);
}
function d2r(d) {
  return d * (Math.PI / 180);
}
function objectArray(all, name) {
  return all.filter(item => item.name == name);
}
const timelineObject = {
  repeat: -1,
  defaults: {
    ease: 'elastic(0.5, 0.43)',
    duration: 1 } };


import { Application } from "https://esm.sh/@splinetool/runtime";
const canvas = document.getElementById('canvas3d');
const app = new Application(canvas);
let allObjects, binPopup, allBins;
app.load(`https://prod.spline.design/${fileName}/scene.splinecode`).
then(() => {

  binPopup = app.findObjectByName('binPopup');
  allBins = app.findObjectByName('allBins');
  allObjects = app.getAllObjects();

  let binPopupArray = objectArray(allObjects, 'binPopup');
  let binBodyArray = objectArray(allObjects, 'binBody');
  let ballArray = objectArray(allObjects, 'ball').reverse();

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

网友评论0