threejs-towers
하는 일
이 스킬은 모델 파일을 불러오지 않고, 작은 형태 빌더 세트를 사용해 코드로 건축물을 만듭니다. 건축 장면, 역사 시각화, 웹 기반 건설 애니메이션을 만드는 개발자를 위한 것입니다.
사용하는 경우
- ✓모델 파일 없이 Three.js 장면에 탑, 성, 돔, 첨탑을 만들고 싶을 때.
- ✓건물이 땅에서부터 올라오는 건설 애니메이션을 원할 때.
- ✓여러 건물이 같은 스타일을 쓰되 설정만 달라야 할 때.
스킬 링크
https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/threejs-towers/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“Three.js로 탑을 코드로 생성하고, 땅에서부터 지어지는 모습을 애니메이션으로 보여 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 상자, 각기둥, 회전체, 지붕을 위한 간단한 빌더를 작성하고, 매개변수로 각 건물을 조립합니다. 클리핑 평면이 건물을 층별로 드러내며, 부품은 재질별로 합쳐져 장면을 빠르게 유지합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Three.js Towers
Architecture is the one subject where procedural generation pays immediately: buildings are made of repeated, parameterised parts, and once you have the vocabulary a second style costs a parameter set rather than a model.
Stand it in threejs-landscape and weather it with threejs-weather.
Build the vocabulary before the building
Write ten small builders that all append into shared vertex/normal/UV/index arrays, then never write raw geometry again:
face(P, uv) quad with a computed normal
box(cx,cy,cz, sx,sy,sz, ry, uvScale, rz)
prism(y0,y1, R0,R1, uv, capTop, capBot) square on plan
prismN(y0,y1, R0,R1, n, uv, capTop, capBot) any n-gon
sweepPlan(plan, y0,y1, steps, profile) an outline scaled up a curve
lathe(cx,cy,cz, y0,y1, profile, steps, seg) surface of revolution
ring / arc annulus on a face plane
fan(points, z, ry, cx, cy) filled polygon on a face
tube(points, r, sides) swept tube
That set covers a Japanese keep, a Chinese pagoda, an Ottoman dome, a Khmer prasat and a Vietnamese tháp. Each style becomes one assembly function plus a table of levels.
Merge by material, not by part. Six buildings drawn in 11–18 draw calls is the difference between 120fps and 30.
Winding is the bug you will hit most. A prism whose side faces are wound inward gets back-face culled and you find yourself looking at the inside of the far wall. Get one prism right, then copy its vertex order everywhere. When a surface goes missing, suspect winding before you suspect anything else.
Roofs are a function of position along the eave
The whole character of an East Asian roof — flat near the ridge, steepening, then curling up at the corners — comes from one function that maps (panel, position across, position down) to a point:
function roofPoint(o, p, u, t) {
const tc = Math.min(1, t);
const g = 1 - Math.pow(1 - tc, o.pow); // the sag of the slope
const corner = Math.pow(Math.abs(u), 2.0); // 0 mid-eave, 1 at hips
const flare = 1 + o.flare * corner * Math.pow(tc, 3.2);
const y = o.yT - (o.yT - o.yE) * g
+ o.lift * corner * Math.pow(tc, 2.6); // corners lift
return [ /* lerp inner edge → outer edge × flare */ ];
}
Six numbers give you every roof in the set: lift, tip, flare, pow, trunc, ridge. trunc is the one that is easy to miss — it lets a lower roof die cleanly behind the wall above it instead of poking through.
Math.pow(negative, 2.35) is NaN. Tiles that overshoot the eave push t past 1, and the whole roof silently disappears. Clamp tc = Math.min(1, t) and handle the overshoot as a separate linear term.
Non-square plans
prismN handles octagons and sixteen-sided drums. For anything with re-entrant corners — a Khmer prasat is a square pushed out on each axis and stepped back twice before the corner — build the outline once and sweep it:
const oct = [[1+P,0],[1+P,0.30],[1.0,0.30],[1.0,0.45],[0.90,0.45], ... ];
const half = oct.concat(oct.slice(0,-1).reverse().map(q => [q[1], q[0]]));
// mirror across the diagonal, then rotate four times
Then every storey is the same outline at a smaller scale, and the silhouette is coherent for free.
Deck the ledges. Where a storey steps back onto the one above, the gap between the two outlines is open. Fill it with a flat annulus on the plan or the tower reads as a stack of floating shelves with daylight between them.
Size detail to the surface it sits on
The most common modelling mistake is not the geometry, it is the proportion. A doorway sized for a face that turns out to be a third as wide spills onto the returns and reads as noise. Measure the face first, then size the door, the colonnettes and the pediment as fractions of it — and check that the pediment finishes under the cornice rather than through it.
The build animation is one clipping plane
Everything exists from the first frame. A plane facing down travels up, and every structural material clips against it:
renderer.localClippingEnabled = true;
const CLIP = new THREE.Plane(new THREE.Vector3(0, -1, 0), 0);
['stone','plaster','tile','timber', ...].forEach(k => {
MAT[k].clippingPlanes = [CLIP];
MAT[k].clipShadows = true; // or the shadow builds early
});
CLIP.constant = heightAt(t);
A clipped shell is hollow,
자주 묻는 질문
3D 모델 파일이 필요한가요?
아니요. 건물은 코드와 매개변수로 생성됩니다.
부품을 재질별로 합치는 이유는 무엇인가요?
스킬은 이렇게 하면 드로우 콜 수가 줄어 프레임 속도가 높게 유지된다고 말합니다.
애니메이션 없이 완성된 건물만 보여줄 수도 있나요?
네. 건설 애니메이션은 절차적으로 만든 건물 위에 더하는 추가 단계입니다.
상세 정보
작성자의 원본 설명
Generate architecture procedurally in Three.js and film it assembling — a small geometry vocabulary that builds pagodas, castles, domes and spires from parameters instead of mesh files, hip roofs with flying eaves driven by a single profile function, and a clipping-plane build animation where everything below a rising line is finished work and scaffolding stands above it. Use for construction studies, architectural title sequences, procedural landmarks, or any hero object that should build itself rather than fade in.
repo: MengTo/Skills
인기도
- GitHub 스타
- 7.2k
- 순위
- #13476
- 라이선스
- MIT
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
3d-cloth-material
7.2k에이전트가 Three.js에서 실 짜임, 부드러운 광택, 자연스러운 주름, 단, 솔기를 갖춘 실제 직물처럼 보이는 천을 만들도록 돕습니다.
3d-falling-leaves
7.2k에이전트가 3D 장면에 나뭇잎이 구르고 바람에 흩날리며 카메라 움직임에 따라 재사용되는 낙엽 효과를 추가하도록 돕습니다.
3d-four-seasons
7.2k에이전트가 3D 장면의 나무, 빛, 하늘, 눈을 바꿔 장면을 다시 만들지 않고 봄, 여름, 가을, 겨울을 표현하도록 돕습니다.
3d-high-poly-models
7.2k에이전트가 매끄러운 형태와 자연스러운 모서리를 가진 세밀한 3D 모델을 만들고, 웹에서 잘 돌아가는 가벼운 버전을 준비하도록 돕습니다.
비슷한 스킬
angular-developer
280k에이전트가 Angular 코드를 만들고 프로젝트 구조를 조언하도록 돕습니다. 새 프로젝트 시작, 코드 부분 생성, 성능과 접근성 개선에 유용합니다.
frontend-a11y
280k모든 사람이 웹 인터페이스를 쓸 수 있도록 에이전트를 돕습니다. 웹사이트와 앱이 화면 읽기 프로그램과 키보드 탐색에서 잘 작동하도록 합니다.
frontend-patterns
280k프론트엔드 개발의 현대적인 패턴을 적용하도록 에이전트를 돕습니다. React와 Next.js에서 성능을 최적화하고, 상태를 관리하며, 모범 사례를 따릅니다.