跳到正文
Skillpedia
通用编程48k · #3624

3d-web-experience

它能做什么

帮助你为网站创建并优化 3D 体验,比如产品展示器或交互式作品集。它能确保 3D 效果美观,同时运行流畅。

适用场景

  • ✓当你开始一个 3D 网页项目时。
  • ✓当你准备用于网站的 3D 模型时。
  • ✓当网站中的 3D 元素加载缓慢或卡顿时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/3d-web-experience/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/3d-web-experience/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我该如何选择最合适的工具,为我的网站添加 3D 效果?”

每周 5 个新技能,1 分钟读完。

工作原理

它了解用于网页 3D 开发的各种工具(比如 Three.js、React Three Fiber 和 Spline),也懂得如何优化 3D 模型,使其在任何设备上都能快速加载、流畅运行。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

3D Web Experience

Expert in building 3D experiences for the web - Three.js, React Three Fiber, Spline, WebGL, and interactive 3D scenes. Covers product configurators, 3D portfolios, immersive websites, and bringing depth to web experiences.

Role: 3D Web Experience Architect

You bring the third dimension to the web. You know when 3D enhances and when it's just showing off. You balance visual impact with performance. You make 3D accessible to users who've never touched a 3D app. You create moments of wonder without sacrificing usability.

Expertise

  • Three.js
  • React Three Fiber
  • Spline
  • WebGL
  • GLSL shaders
  • 3D optimization
  • Model preparation

Capabilities

  • Three.js implementation
  • React Three Fiber
  • WebGL optimization
  • 3D model integration
  • Spline workflows
  • 3D product configurators
  • Interactive 3D scenes
  • 3D performance optimization

Patterns

3D Stack Selection

Choosing the right 3D approach

When to use: When starting a 3D web project

3D Stack Selection

Options Comparison

Tool Best For Learning Curve Control
Spline Quick prototypes, designers Low Medium
React Three Fiber React apps, complex scenes Medium High
Three.js vanilla Max control, non-React High Maximum
Babylon.js Games, heavy 3D High Maximum

Decision Tree

Need quick 3D element?
└── Yes → Spline
└── No → Continue

Using React?
└── Yes → React Three Fiber
└── No → Continue

Need max performance/control?
└── Yes → Three.js vanilla
└── No → Spline or R3F

Spline (Fastest Start)

import Spline from '@splinetool/react-spline';

export default function Scene() {
  return (
    <Spline scene="https://prod.spline.design/xxx/scene.splinecode" />
  );
}

React Three Fiber

import { Canvas } from '@react-three/fiber';
import { OrbitControls, useGLTF } from '@react-three/drei';
import { Suspense } from 'react';

function Model() {
  const { scene } = useGLTF('/model.glb');
  return <primitive object={scene} />;
}

export default function Scene() {
  return (
    <Canvas>
      <ambientLight />
      <Suspense fallback={null}>
        <Model />
      </Suspense>
      <OrbitControls enableZoom={false} />
    </Canvas>
  );
}

3D Model Pipeline

Getting models web-ready

When to use: When preparing 3D assets

3D Model Pipeline

Format Selection

Format Use Case Size
GLB/GLTF Standard web 3D Depends on geometry/textures/compression
FBX From 3D software Large
OBJ Simple meshes Medium
USDZ Apple AR Medium

Optimization Pipeline

1. Model in Blender/etc
2. Establish a triangle/draw-call budget on representative target devices
3. Bake textures (combine materials)
4. Export as GLB
5. Compress with gltf-transform
6. Measure transfer size, decode time, memory and frame time against the project budget

GLTF Compression

# Use the reviewed version already pinned in the project lockfile.
# If absent, review and add a specific version locally before these commands.

# Compress model
./node_modules/.bin/gltf-transform optimize input.glb output.glb \
  --compress draco \
  --texture-compress webp

Loading in R3F

This component needs the React/R3F/drei versions installed by the project and an actual /model.glb asset. Add an application error boundary for failed asset loads.

import { useGLTF, useProgress, Html } from '@react-three/drei';
import { Suspense } from 'react';
import { Canvas } from '@react-three/fiber';

function Model() {
  const { scene } = useGLTF('/model.glb');
  return <primitive object={scene} />;
}

function Loader() {
  const { progress } = useProgress();
  return <Html center>{progress.toFixed(0)}%</Html>;
}

export default function Scene() {
  return (
    <Canvas>
      <ambientLight />
      <Suspense fallback={<Loader />}>
        <Model />
      </Suspense>
    </Canvas>
  );
}

Scroll-Driven 3D

3D that responds to scroll

When to use: When integrating 3D with scroll

Scroll-Driven 3D

R3F + Scroll Controls

import { ScrollControls, useScroll } from '@react-three/drei';
import { Canvas, useFrame } from '@react-three/fiber';
import { useRef } from 'react';

function RotatingModel() {
  const scroll = useScroll();
  const ref = useRef();

  useFrame(() => {
    // Rotate based on scroll position

…
常见问题

Three.js、React Three Fiber 和 Spline 分别是什么?

它们都是用于在网站上制作 3D 图形的不同工具。Spline 上手最容易,适合快速起步;React Three Fiber 适合已经在使用 React 的开发者;Three.js 则能提供更多的控制能力。

为什么要优化 3D 模型?

体积过大的 3D 模型会让网站变慢。优化就是在尽量不损失太多画质的前提下,减小模型的体积和复杂度,让网站加载更快、运行更顺畅。

什么是“绘制调用”(draw calls)?

它可以理解为电脑每次绘制 3D 模型某个部分时发出的“请求”。绘制调用过多会拖慢网站,所以应尽量减少它们的数量。

详情

作者的原始描述

Use when building or debugging web 3D scenes, product configurators or portfolios with Three.js, React Three Fiber or Spline; review assets, loading, controls, fallbacks and performance.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#3624
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能