본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)7.2k · #13478

threejs

하는 일

이 스킬은 회전시킬 수 있는 제품이나 움직이는 히어로 장면처럼 웹 브라우저에서 실행되는 3D 장면을 만드는 방법을 AI에게 안내합니다. 단순한 배경 효과를 넘어 진짜 3D를 원하는 디자이너와 개발자를 위한 것입니다.

사용하는 경우

  • ✓웹사이트에서 사람들이 회전시키거나 탐색할 수 있는 3D 제품을 원할 때.
  • ✓작동하는 조명과 컨트롤을 갖춘 3D 모델을 불러와 페이지에 보여줘야 할 때.
  • ✓3D 장면이 느리거나 화면 크기를 바꾸면 깨져서 고쳐야 하는 경우.

스킬 링크

https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/threejs/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/threejs/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“내 웹사이트에 3D 제품 뷰어를 만들어 주세요. 사람들이 마우스로 병을 돌려 볼 수 있어야 합니다.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

스킬은 카메라, 조명, 렌더러처럼 3D 장면에 필요한 요소를 설명하고, 모델을 불러오고 장면을 빠르게 유지하는 패턴을 제공합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Three.js — WebGL 3D Scenes Skill

When to use

  • Real 3D: product spins, interactive hero scenes, shaders/material effects, 3D data viz
  • You need full control beyond “background effects”
  • You can budget time for asset pipeline + performance tuning

Core mental model

  • Create:
    • Scene (root graph)
    • Camera (Perspective/Orthographic)
    • Renderer (WebGLRenderer)
    • Mesh = Geometry + Material
    • Lights (if using non-unlit materials)
  • Render loop:
    • requestAnimationFrame(animate)
    • Update time-based animations, controls, mixers, then renderer.render(scene, camera)

Key APIs/patterns

  • Setup:
    • const renderer = new THREE.WebGLRenderer({ canvas, antialias, alpha })
    • renderer.setSize(width, height, false)
    • renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2))
  • Camera:
    • camera.aspect = width / height; camera.updateProjectionMatrix()
  • Scene graph:
    • scene.add(object) / object.position/rotation/scale
  • Loading assets:
    • GLTFLoader (models), TextureLoader (images), DRACOLoader (compressed glTF)
  • Controls (common):
    • OrbitControls (debug/product), PointerLockControls (FPS), custom pointer handlers
  • Cleanup (important in SPAs):
    • geometry.dispose(), material.dispose(), texture.dispose(), renderer.dispose()
    • Remove event listeners; cancel RAF.

Common pitfalls

  • Not handling resize → stretched/cropped rendering
  • Too high devicePixelRatio → mobile GPU meltdown
  • Leaking WebGL resources (not disposing) → crashes after route changes
  • Loading huge textures/models → slow start; use compressed textures, Draco/KTX2, smaller maps
  • Using too many lights/shadows → expensive; fake lighting with baked textures when possible

Quick recipes

1) Minimal spinning cube

import * as THREE from "three";

const canvas = document.querySelector("#c");
const renderer = new THREE.WebGLRenderer({ canvas, antialias: true, alpha: true });

const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(45, 1, 0.1, 100);
camera.position.set(0, 0, 4);

const geom = new THREE.BoxGeometry(1, 1, 1);
const mat = new THREE.MeshStandardMaterial({ color: 0x7c3aed });
const mesh = new THREE.Mesh(geom, mat);
scene.add(mesh);

scene.add(new THREE.AmbientLight(0xffffff, 0.8));
const dir = new THREE.DirectionalLight(0xffffff, 0.8);
dir.position.set(2, 2, 2);
scene.add(dir);

function resize() {
  const w = canvas.clientWidth;
  const h = canvas.clientHeight;
  renderer.setSize(w, h, false);
  renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
  camera.aspect = w / h;
  camera.updateProjectionMatrix();
}
window.addEventListener("resize", resize);
resize();

function animate(t) {
  mesh.rotation.y = t * 0.0006;
  renderer.render(scene, camera);
  requestAnimationFrame(animate);
}
requestAnimationFrame(animate);

2) Respect reduced motion

  • If prefers-reduced-motion: reduce, render a still frame (no RAF) or slow updates.

What to ask the user

  • Is this decorative (hero) or functional 3D (product viewer)?
  • Target devices: mobile? older iPhones?
  • Asset format availability (glTF, HDRI, textures) and file size constraints
  • Accessibility/reduced motion requirements
자주 묻는 질문

3D 프로그래밍을 알아야 쓸 수 있나요?

아니요. 스킬은 AI에게 장면 설정 방법을 알려주지만, 페이지에서 보고 싶은 모습은 직접 설명해야 합니다.

3D 모델 파일을 불러올 수 있나요?

네. 웹에서 많이 쓰는 3D 객체 형식인 glTF 모델을 불러오는 방법을 다룹니다.

큰 3D 프로젝트에만 쓰나요?

아니요. 랜딩 페이지의 작은 인터랙티브 3D 장면 하나에도 도움이 됩니다.

상세 정보

작성자의 원본 설명

Use when building or debugging interactive 3D scenes on the web with Three.js (scene/camera/renderer, lights/materials, GLTF loading, controls, performance). Helpful for designers shipping 3D UI moments.

repo: MengTo/Skills

인기도

GitHub 스타
7.2k
순위
#13478
라이선스
MIT
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬