three+mediapipe摄像头手势控制宇宙星尘行星光环粒子动画效果代码

代码语言:html

所属分类:三维

代码描述:three+mediapipe摄像头手势控制宇宙星尘行星光环粒子动画效果代码,手势:缩放模式 五指张开/握拳 → 粒子扩散 + 颜色爆发 ☝️ 视角旋转 仅伸食指 → 相机坐标系 XY 轴旋转 ✌️ 平面翻转 食指+中指 → Z 轴旋转 (1:1 跟手)

代码标签: three mediapipe 摄像头 手势 控制 宇宙 星尘 行星 粒子 光环 动画

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

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>粒子宇宙行星 - 手势控制系统</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            overflow: hidden;
            background: #000;
            font-family: 'Segoe UI', Arial, sans-serif;
        }
        
        #container {
            width: 100vw;
            height: 100vh;
            position: relative;
        }
        
        #video-container {
            position: fixed;
            bottom: 20px;
            right: 20px;
            width: 280px;
            height: 210px;
            border: 3px solid rgba(0,255,136,0.5);
            border-radius: 16px;
            overflow: hidden;
            z-index: 100;
            background: rgba(0,0,0,0.8);
            box-shadow: 0 0 30px rgba(0,255,136,0.3);
        }
        
        #video {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transform: scaleX(-1);
        }
        
        #overlay-canvas {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            transform: scaleX(-1);
            pointer-events: none;
        }
        
        #info-panel {
            position: fixed;
            top: 20px;
            left: 20px;
            background: rgba(10, 15, 30, 0.85);
            backdrop-filter: blur(15px);
            padding: 25px;
            border-radius: 20px;
            color: white;
            z-index: 100;
            min-width: 320px;
            border: 1px solid rgba(100,150,255,0.3);
            box-shadow: 0 10px 40px rgba(0,0,0,0.5);
        }
        
        .panel-title {
            text-align: center;
            font-size: 22px;
            margin-bottom: 20px;
            background: linear-gradient(135deg, #00ff88, #00aaff, #aa00ff);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            font-weight: bold;
        }
        
        .gesture-item {
            display: flex;
            align-items: center;
            margin: 12px 0;
            padding: 12px 15px;
            background: rgba(255,255,255,0.03);
            border-radius: 12px;
            border: 1px solid rgba(255,255,255,0.05);
            transition: all 0.3s ease;
        }
        
        .gesture-item.active {
            background: rgba(0,255,136,0.1);
            border-color: rgba(0,255,136,0.4);
            box-shadow: 0 0 20px rgba(0,255,136,0.2);
        }
        
        .gesture-icon {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 15px;
            font-size: 24px;
            background: rgba(255,255,255,0.05);
            border: 2px solid rgba(255,255,255,0.1);
            transition: all 0.3s ease;
        }
        
        .gesture-item.active .gesture-icon {
            background: linear-gradient(135deg, #00ff88, #00aaff);
            border-color: transparent;
            box-shadow: 0 0 25px rgba(0,255,136,0.6);
            animation: pulse 1s ease-in-out infinite;
        }
        
        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.1); }
        }
        
        .gesture-info {
            flex: 1;
        }
        
        .gesture-name {
            font-weight: bold;
            font-size: 15px;
            margin-bottom: 4px;
        }
        
        .gesture-desc {
            font-size: 12px;
            color: rgba(255,255,255,0.5);
        }
        
        #mode-display {
            text-align: center;
            padding: 18px;
            margin-top: 20px;
            background: linear-gradient(135deg, rgba(50,50,80,0.5), rgba(30,30,60,0.5));
            border-radius: 15px;
            font-size: 20px;
            font-weight: bold;
            border: 1px solid rgba(255,255,255,0.1);
        }
        
        #state-indicator {
            display: flex;
            align-items: center;
            justify-content: center;
            margin-top: 15px;
            padding: 10px;
            background: rgba(0,0,0,0.3);
            border-radius: 10px;
        }
        
        .state-dot {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            margin-right: 10px;
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0