three操控vrm美女模型三维跑道移动跳动行走代码

代码语言:html

所属分类:三维

代码描述:three操控vrm美女模型三维跑道移动跳动行走代码

代码标签: three 操控 vrm 美女 模型 三维 移动 跑道 跳动 行走

下面为部分代码预览,完整代码请点击下载或在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>VRM 赛道行走</title>
    <style>
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body { overflow: hidden; background: #000; font-family: Arial, sans-serif; }
        canvas { display: block; }
        
        #loading {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: linear-gradient(135deg, #1a1a2e, #16213e);
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            z-index: 1000; color: white;
        }
        #loading h1 { font-size: 2em; margin-bottom: 20px; }
        #loading .spinner {
            width: 50px; height: 50px; border: 4px solid rgba(255,255,255,0.3);
            border-top: 4px solid #fff; border-radius: 50%;
            animation: spin 1s linear infinite;
        }
        @keyframes spin { to { transform: rotate(360deg); } }
        #loadingText { margin-top: 20px; font-size: 1.1em; }
        
        #hud {
            position: fixed; top: 20px; left: 20px; color: white;
            font-size: 14px; z-index: 100; pointer-events: none;
        }
        #hud div {
            background: rgba(0,0,0,0.6); padding: 8px 14px;
            margin-bottom: 6px; border-radius: 8px;
            backdrop-filter: blur(5px);
        }
        
        #controls {
            position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
            color: white; font-size: 13px; z-index: 100;
            background: rgba(0,0,0,0.6); padding: 12px 24px;
            border-radius: 12px; backdrop-filter: blur(5px);
            text-align: center; pointer-events: none;
        }
        #controls span { 
            display: inline-block; background: rgba(255,255,255,0.2); 
            padding: 2px 8px; border-radius: 4px; margin: 0 2px;
            font-weight: bold;
        }
        
        #mobileControls {
            display: none; position: fixed; bottom: 20px; z-index: 100;
            width: 100%;
        }
        @media (max-width: 768px) {
            #mobileControls { display: flex; justify-content: space-between; padding: 0 20px; }
            #controls { display: none; }
        }
        .mobile-btn {
            width: 60px; height: 60px; border-radius: 50%;
            background: rgba(255,255,255,0.25); border: 2px solid rgba(255,255,255,0.4);
            color: white; font-size: 20px; display: flex; align-items: center;
            justify-content: center; cursor: pointer; user-select: none;
            backdrop-filter: blur(5px);
        }
        .mobile-btn:active { background: rgba(255,255,255,0.5); }
        .dpad { display: grid; grid-template-columns: 60px 60px 60px; gap: 4px; }
        .dpad .empty { visibility: hidden; }
    </style>
</head>
<body>
    <div id="loading">
        <h1>🏃 VRM 赛道行走</h1>
        <div class="spinner"></div>
        <div id="loadingText">正在加载资源...</div>
    </div>
    
    <div id="hud">
        <div id="speedDisplay">速度: 0</div>
        <div id="stateDisplay">状态: 站立</div>
        <div id="viewDisplay">视角: 第三人称</div>
        <div id="distDisplay">距离: 0m</div>
    </div>
    
    <div id="controls">
        <span>W/↑</span> 前进 &nbsp; <span>S/↓</span> 后退 &nbsp;
        <span>A/←</span> 左转 &nbsp; <span>D/→</span> 右转 &nbsp;
        <span>Shift</span> 跑步 &nbsp; <span>Space</span> 跳跃 &nbsp;
        <span>V</span> 切换视角 &nbsp; <span>鼠标</span> 旋转视角
    </div>
    
    <div id="mobileControls">
        <div class="dpad">
            <div class="empty"></div>
            <div class="mobile-btn" id="btnUp"&g.........完整代码请登录后点击上方下载按钮下载查看

网友评论0