three实现减少顶点数对glb三维模型轻量化粗糙化处理代码

代码语言:html

所属分类:三维

代码描述:three实现减少顶点数对glb三维模型轻量化粗糙化处理代码,可有效较低模型的文件大小,但是会显得粗糙一点。

代码标签: three 减少 顶点数 glb 三维 模型 轻量化 粗糙化 处理 代码

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

<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>GLB 模型轻量化/粗糙化工具</title>
    <style>
        body { margin: 0; overflow: hidden; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #222; color: #eee; }
        #container { width: 100vw; height: 100vh; }
        
        /* 侧边栏 UI */
        #ui-panel {
            position: absolute; top: 0; left: 0; bottom: 0;
            width: 320px; background: rgba(30, 30, 30, 0.9);
            padding: 20px; box-sizing: border-box;
            border-right: 1px solid #444;
            overflow-y: auto;
            display: flex; flex-direction: column; gap: 15px;
        }

        h2 { margin: 0 0 10px 0; font-size: 18px; color: #4CAF50; }
        h3 { margin: 10px 0 5px 0; font-size: 14px; color: #aaa; text-transform: uppercase; letter-spacing: 1px; }

        .file-upload {
            border: 2px dashed #555; padding: 20px; text-align: center;
            cursor: pointer; border-radius: 5px; transition: 0.3s;
        }
        .file-upload:hover { border-color: #4CAF50; background: #333; }
        input[type="file"] { display: none; }

        .stat-box {
            background: #333; padding: 10px; border-radius: 4px; font-size: 13px;
            display: flex; justify-content: space-between;
        }
        .stat-val { font-weight: bold; color: #fff; }
        .diff-good { color: #4CAF50; }
        .diff-bad { color: #ff5252; }

        label { font-size: 13px; display: block; margin-bottom: 5px; }
        input[type="range"] { width: 100%; cursor: pointer.........完整代码请登录后点击上方下载按钮下载查看

网友评论0