three+mediapipe摄像头手势控制宇宙星尘行星光环粒子动画效果代码
代码语言:html
所属分类:粒子
代码描述:three+mediapipe摄像头手势控制宇宙星尘行星光环粒子动画效果代码,手势: 1. 食指移动 -> XY轴旋转 2. 食指+中指 -> Z轴平面翻转 3. 五指张开/握拳 -> 粒子爆发/收
代码标签: three mediapipe 摄像头 手势 控制 宇宙 星尘 行星 粒子 光环 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>粒子宇宙手势控制系统</title>
<style>
body { margin: 0; overflow: hidden; background-color: #000; font-family: 'Courier New', Courier, monospace; }
canvas { display: block; }
#video-container {
position: absolute;
bottom: 20px;
right: 20px;
width: 200px;
height: 150px;
border: 2px solid #00ffcc;
border-radius: 10px;
overflow: hidden;
opacity: 0.7;
z-index: 10;
}
#input_video {
width: 100%;
height: 100%;
object-fit: cover;
transform: scaleX(-1); /* 镜像翻转 */
}
#ui-layer {
position: absolute;
top: 20px;
left: 20px;
color: white;
pointer-events: none;
z-index: 10;
}
.status {
font-size: 14px;
margin-bottom: 5px;
text-shadow: 0 0 5px #000;
}
.mode-active {
color: #00ffcc;
font-weight: bold;
font-size: 18px;
}
#loading {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: #00ffcc;
font-size: 24px;
z-index: 20;
}
</style>
<!-- 引入 Three.js -->
<script src="https://cdn.jsdelivr.net/npm/three@0.146.0/build/three.min.js"></script>
<!-- 引入 MediaPipe -->
<script src="https://cdn.jsdelivr.net/npm/@mediapipe/camera_utils/camera_util.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0