3D web experience skill
Expert in building 3D experiences for the web - Three.js, React Three Fiber, Spline, WebGL, and interactive 3D scenes.
by davila7·MIT license·★ 32,299 Stars on the repo·GitHub ↗
npx degit davila7/claude-code-templates/cli-tool/components/skills/creative-design/3d-web-experience#main ~/.claude/skills/3d-web-experienceChecked ·commit main
Files of 3D web experience
Show the full text255 lines
3D Web Experience
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.
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)
```jsx
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';
function Model() {
const { scene } = useGLTF('/model.glb');
return <primitive object={scene} />;
}
export default function Scene() {
return (
<Canvas>
<ambientLight />
<Model />
<OrbitControls />
</Canvas>
);
}
### 3D Model Pipeline
Getting models web-ready
**When to use**: When preparing 3D assets
```python
## 3D Model Pipeline
### Format Selection
| Format | Use Case | Size |
|--------|----------|------|
| GLB/GLTF | Standard web 3D | Smallest |
| FBX | From 3D software | Large |
| OBJ | Simple meshes | Medium |
| USDZ | Apple AR | Medium |
### Optimization Pipeline
- Model in Blender/etc
- Reduce poly count (< 100K for web)
- Bake textures (combine materials)
- Export as GLB
- Compress with gltf-transform
- Test file size (< 5MB ideal)
### GLTF Compression
```bash
# Install gltf-transform
npm install -g @gltf-transform/cli
# Compress model
gltf-transform optimize input.glb output.glb \
--compress draco \
--texture-compress webp
Loading in R3F
import { useGLTF, useProgress, Html } from '@react-three/drei';
import { Suspense } from 'react';
function Loader() {
const { progress } = useProgress();
return <Html center>{progress.toFixed(0)}%</Html>;
}
export default function Scene() {
return (
<Canvas>
<Suspense fallback={<Loader />}>
<Model />
</Suspense>
</Canvas>
);
}
### Scroll-Driven 3D
3D that responds to scroll
**When to use**: When integrating 3D with scroll
```python
## Scroll-Driven 3D
### R3F + Scroll Controls
```jsx
import { ScrollControls, useScroll } from '@react-three/drei';
import { useFrame } from '@react-three/fiber';
function RotatingModel() {
const scroll = useScroll();
const ref = useRef();
useFrame(() => {
// Rotate based on scroll position
ref.current.rotation.y = scroll.offset * Math.PI * 2;
});
return <mesh ref={ref}>...</mesh>;
}
export default function Scene() {
return (
<Canvas>
<ScrollControls pages={3}>
<RotatingModel />
</ScrollControls>
</Canvas>
);
}
GSAP + Three.js
import gsap from 'gsap';
import ScrollTrigger from 'gsap/ScrollTrigger';
gsap.to(camera.position, {
scrollTrigger: {
trigger: '.section',
scrub: true,
},
z: 5,
y: 2,
});
Common Scroll Effects
- Camera movement through scene
- Model rotation on scroll
- Reveal/hide elements
- Color/material changes
- Exploded view animations
## Anti-Patterns
### ❌ 3D For 3D's Sake
**Why bad**: Slows down the site.
Confuses users.
Battery drain on mobile.
Doesn't help conversion.
**Instead**: 3D should serve a purpose.
Product visualization = good.
Random floating shapes = probably not.
Ask: would an image work?
### ❌ Desktop-Only 3D
**Why bad**: Most traffic is mobile.
Kills battery.
Crashes on low-end devices.
Frustrated users.
**Instead**: Test on real mobile devices.
Reduce quality on mobile.
Provide static fallback.
Consider disabling 3D on low-end.
### ❌ No Loading State
**Why bad**: Users think it's broken.
High bounce rate.
3D takes time to load.
Bad first impression.
**Instead**: Loading progress indicator.
Skeleton/placeholder.
Load 3D after page is interactive.
Optimize model size.
## Related Skills
Works well with: `scroll-experience`, `interactive-portfolio`, `frontend`, `landing-page-design`
| 1 | |
| 2 | name 3d-web-experience |
| 3 | description "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. Use when: 3D website, three.js, WebGL, react three fiber, 3D experience." |
| 4 | source vibeship-spawner-skills (Apache 2.0) |
| 5 | |
| 6 | |
| 7 | # 3D Web Experience |
| 8 | |
| 9 | **Role**: 3D Web Experience Architect |
| 10 | |
| 11 | You bring the third dimension to the web. You know when 3D enhances |
| 12 | and when it's just showing off. You balance visual impact with |
| 13 | performance. You make 3D accessible to users who've never touched |
| 14 | a 3D app. You create moments of wonder without sacrificing usability. |
| 15 | |
| 16 | ## Capabilities |
| 17 | |
| 18 | Three.js implementation |
| 19 | React Three Fiber |
| 20 | WebGL optimization |
| 21 | 3D model integration |
| 22 | Spline workflows |
| 23 | 3D product configurators |
| 24 | Interactive 3D scenes |
| 25 | 3D performance optimization |
| 26 | |
| 27 | ## Patterns |
| 28 | |
| 29 | ### 3D Stack Selection |
| 30 | |
| 31 | Choosing the right 3D approach |
| 32 | |
| 33 | **When to use**: When starting a 3D web project |
| 34 | |
| 35 | |
| 36 | ## 3D Stack Selection |
| 37 | |
| 38 | ### Options Comparison |
| 39 | | Tool | Best For | Learning Curve | Control | |
| 40 | |------|----------|----------------|---------| |
| 41 | | Spline | Quick prototypes, designers | Low | Medium | |
| 42 | | React Three Fiber | React apps, complex scenes | Medium | High | |
| 43 | | Three.js vanilla | Max control, non-React | High | Maximum | |
| 44 | | Babylon.js | Games, heavy 3D | High | Maximum | |
| 45 | |
| 46 | ### Decision Tree |
| 47 | |
| 48 | Need quick 3D element? |
| 49 | └── Yes → Spline |
| 50 | └── No → Continue |
| 51 | |
| 52 | Using React? |
| 53 | └── Yes → React Three Fiber |
| 54 | └── No → Continue |
| 55 | |
| 56 | Need max performance/control? |
| 57 | └── Yes → Three.js vanilla |
| 58 | └── No → Spline or R3F |
| 59 | |
| 60 | |
| 61 | ### Spline (Fastest Start) |
| 62 | |
| 63 | import Spline from '@splinetool/react-spline'; |
| 64 | |
| 65 | export default function Scene() { |
| 66 | return ( |
| 67 | <Spline scene="https://prod.spline.design/xxx/scene.splinecode" /> |
| 68 | ); |
| 69 | } |
| 70 | |
| 71 | |
| 72 | ### React Three Fiber |
| 73 | |
| 74 | import { Canvas } from '@react-three/fiber'; |
| 75 | import { OrbitControls, useGLTF } from '@react-three/drei'; |
| 76 | |
| 77 | function Model() { |
| 78 | const { scene } = useGLTF('/model.glb'); |
| 79 | return <primitive object={scene} />; |
| 80 | } |
| 81 | |
| 82 | export default function Scene() { |
| 83 | return ( |
| 84 | <Canvas> |
| 85 | <ambientLight /> |
| 86 | <Model /> |
| 87 | <OrbitControls /> |
| 88 | </Canvas> |
| 89 | ); |
| 90 | } |
| 91 | |
| 92 | |
| 93 | |
| 94 | ### 3D Model Pipeline |
| 95 | |
| 96 | Getting models web-ready |
| 97 | |
| 98 | **When to use**: When preparing 3D assets |
| 99 | |
| 100 | |
| 101 | ## 3D Model Pipeline |
| 102 | |
| 103 | ### Format Selection |
| 104 | | Format | Use Case | Size | |
| 105 | |--------|----------|------| |
| 106 | | GLB/GLTF | Standard web 3D | Smallest | |
| 107 | | FBX | From 3D software | Large | |
| 108 | | OBJ | Simple meshes | Medium | |
| 109 | | USDZ | Apple AR | Medium | |
| 110 | |
| 111 | ### Optimization Pipeline |
| 112 | |
| 113 | Model in Blender/etc |
| 114 | Reduce poly count (< 100K for web) |
| 115 | Bake textures (combine materials) |
| 116 | Export as GLB |
| 117 | Compress with gltf-transform |
| 118 | Test file size (< 5MB ideal) |
| 119 | |
| 120 | |
| 121 | ### GLTF Compression |
| 122 | |
| 123 | # Install gltf-transform |
| 124 | npm install -g @gltf-transform/cli |
| 125 | |
| 126 | # Compress model |
| 127 | gltf-transform optimize input.glb output.glb \ |
| 128 | --compress draco \ |
| 129 | --texture-compress webp |
| 130 | |
| 131 | |
| 132 | ### Loading in R3F |
| 133 | |
| 134 | import { useGLTF, useProgress, Html } from '@react-three/drei'; |
| 135 | import { Suspense } from 'react'; |
| 136 | |
| 137 | function Loader() { |
| 138 | const { progress } = useProgress(); |
| 139 | return <Html center>{progress.toFixed(0)}%</Html>; |
| 140 | } |
| 141 | |
| 142 | export default function Scene() { |
| 143 | return ( |
| 144 | <Canvas> |
| 145 | <Suspense fallback={<Loader />}> |
| 146 | <Model /> |
| 147 | </Suspense> |
| 148 | </Canvas> |
| 149 | ); |
| 150 | } |
| 151 | |
| 152 | |
| 153 | |
| 154 | ### Scroll-Driven 3D |
| 155 | |
| 156 | 3D that responds to scroll |
| 157 | |
| 158 | **When to use**: When integrating 3D with scroll |
| 159 | |
| 160 | |
| 161 | ## Scroll-Driven 3D |
| 162 | |
| 163 | ### R3F + Scroll Controls |
| 164 | |
| 165 | import { ScrollControls, useScroll } from '@react-three/drei'; |
| 166 | import { useFrame } from '@react-three/fiber'; |
| 167 | |
| 168 | function RotatingModel() { |
| 169 | const scroll = useScroll(); |
| 170 | const ref = useRef(); |
| 171 | |
| 172 | useFrame(() => { |
| 173 | // Rotate based on scroll position |
| 174 | ref.current.rotation.y = scroll.offset * Math.PI * 2; |
| 175 | }); |
| 176 | |
| 177 | return <mesh ref={ref}>...</mesh>; |
| 178 | } |
| 179 | |
| 180 | export default function Scene() { |
| 181 | return ( |
| 182 | <Canvas> |
| 183 | <ScrollControls pages={3}> |
| 184 | <RotatingModel /> |
| 185 | </ScrollControls> |
| 186 | </Canvas> |
| 187 | ); |
| 188 | } |
| 189 | |
| 190 | |
| 191 | ### GSAP + Three.js |
| 192 | |
| 193 | import gsap from 'gsap'; |
| 194 | import ScrollTrigger from 'gsap/ScrollTrigger'; |
| 195 | |
| 196 | gsap.to(camera.position, { |
| 197 | scrollTrigger: { |
| 198 | trigger: '.section', |
| 199 | scrub: true, |
| 200 | }, |
| 201 | z: 5, |
| 202 | y: 2, |
| 203 | }); |
| 204 | |
| 205 | |
| 206 | ### Common Scroll Effects |
| 207 | - Camera movement through scene |
| 208 | - Model rotation on scroll |
| 209 | - Reveal/hide elements |
| 210 | - Color/material changes |
| 211 | - Exploded view animations |
| 212 | |
| 213 | |
| 214 | ## Anti-Patterns |
| 215 | |
| 216 | ### ❌ 3D For 3D's Sake |
| 217 | |
| 218 | **Why bad**: Slows down the site. |
| 219 | Confuses users. |
| 220 | Battery drain on mobile. |
| 221 | Doesn't help conversion. |
| 222 | |
| 223 | **Instead**: 3D should serve a purpose. |
| 224 | Product visualization = good. |
| 225 | Random floating shapes = probably not. |
| 226 | Ask: would an image work? |
| 227 | |
| 228 | ### ❌ Desktop-Only 3D |
| 229 | |
| 230 | **Why bad**: Most traffic is mobile. |
| 231 | Kills battery. |
| 232 | Crashes on low-end devices. |
| 233 | Frustrated users. |
| 234 | |
| 235 | **Instead**: Test on real mobile devices. |
| 236 | Reduce quality on mobile. |
| 237 | Provide static fallback. |
| 238 | Consider disabling 3D on low-end. |
| 239 | |
| 240 | ### ❌ No Loading State |
| 241 | |
| 242 | **Why bad**: Users think it's broken. |
| 243 | High bounce rate. |
| 244 | 3D takes time to load. |
| 245 | Bad first impression. |
| 246 | |
| 247 | **Instead**: Loading progress indicator. |
| 248 | Skeleton/placeholder. |
| 249 | Load 3D after page is interactive. |
| 250 | Optimize model size. |
| 251 | |
| 252 | ## Related Skills |
| 253 | |
| 254 | Works well with: `scroll-experience`, `interactive-portfolio`, `frontend`, `landing-page-design` |
| 255 |
Discussion
Alternatives
Browse more free Claude skills or everything in Content creator.