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

3d-orbit-inspect-demo

하는 일

이 스킬은 두 가지 모드를 가진 3D 물체 보기를 만드는 과정을 안내합니다. 방문자가 탐색할 수 있는 제품, 포트폴리오, 공예품을 만드는 웹 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓3D 제품이 마우스를 올리면 커서 쪽으로 살짝 기울어야 할 때.
  • ✓방문자가 물체를 클릭해 집어 들고 돌려볼 수 있어야 할 때.
  • ✓Esc 키나 닫기 버튼으로 닫히는 전체 검사 화면이 필요할 때.

스킬 링크

https://github.com/MengTo/Skills/blob/main/agent-skills/3d/3d-orbit-inspect-demo/SKILL.md

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

사용 방법

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

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

Use this skill to help me: https://github.com/MengTo/Skills/blob/main/agent-skills/3d/3d-orbit-inspect-demo/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분.

작동 방식

마우스를 올리면 카메라가 물체 주위를 살짝 기울입니다. 클릭하면 물체가 카메라 앞의 고정된 자리로 올라오고, 방문자는 드래그해서 돌려보거나 Esc 키 또는 닫기 버튼으로 화면을 닫을 수 있습니다.

기술 내용 (원본 SKILL.md)

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

3D Orbit and Inspect

Three.js · WebGL. No OrbitControls, no custom shaders.

The mechanism: hover leans the camera a few degrees around the object with a gain that rises only while a raycast hits it, and click hands the object (not the camera) to a second render layer that lifts it to a fixed spot in front of the lens. The two modes share no state except one rule: the lean freezes whenever a click is possible or the piece is in the hand. Remove that rule and the target slides out from under the click.

Nearest skills: webgl-3d-object (a floating mesh, no inspect), 3d-virtual-tour (its "orbit inspection" is one mode of a walkthrough; the camera itself flies). Reach for this when there is one object and two gestures on it.

Reuse demo.html: the joint, the room, the lean, the lift and the return are all in one module. Copy updateLean, updateHand, openInspect, closeInspect, the pointer block and draw. Swap the meshes for your own object; nothing else names the joint except FROM, RR and Q_BENCH.

What is and is not in the source

Kibori (kibori.html, section "8b. Inspect — pick an item up") has click-to-lift with drag-to-turn, an idle wheel, a "Look closer" cue and a zoom-in cursor on hover, and close by click-away, Esc, scroll or its Close button. It has no hover orbit: the camera only leans a few degrees as scroll dollies it between stations. It also has no free zoom, because wheel is the page scroll and closes the piece. So:

  • Ported unchanged: the item is lifted, the camera is not flown; the layer-1 second pass; the 1-(1-k)^4.4 lift ease; 1.0 s in, 0.60 s home, 0.28 s fast close; the way home straightens before it descends (sstep(0,.36) then sstep(.24,1)); drag 0.0085 / 0.0065 rad per px; spin damping exp(-2.4 dt); idle turn 0.26 rad/s after 2.2 s; click = under 6 px and 600 ms; the band between the top bar and the caption; the cue pill. Not ported: Kibori's hand-written tone-mapping pass and blur of the room behind the piece; the demo uses ACESFilmic and a flat dim.
  • Built here in the Kibori manner: the hover lean, the wheel/pinch dolly, arrow-key and +/- control, focus return, the live region, the touch sway.

Rules, each with the failure it prevents

  1. Freeze the lean on pointerdown and while inspecting. Otherwise the camera keeps easing during a 100 ms click and the raycast at pointerup misses a piece that moved 6 px. Raycast again at pointerup, on the same layer the piece is on.
  2. Gain from a raycast, target from the pointer relative to the piece. g rises to 1 only while the ray hits (tau 0.30 s); the target is clamp((pointer - pieceCentre)/(0.18 W), -1, 1). Screen-centre pointer maps make the piece drift whenever the mouse is anywhere on the page.
  3. Bound and damp. Azimuth ±0.30 rad, elevation ±0.09 rad, 1 - exp(-4.5 dt). Unbounded lean turns the object edge-on; an undamped one jitters with a 1 px mouse.
  4. Hover is the last pointer, not a media query. (hover:hover) lies on hybrid laptops and headless Chrome. Read pointerType on pointermove; touch gets a slow sway (±0.6 of the bound at 0.55 rad/s) so the depth is still shown without hover.
  5. Click and drag are one pointerdown. Under 6 px and under 600 ms opens; anything else is a drag and never opens. In the hand the same 6 px test separates "turn" from "click away". Set touch-action:none on the canvas only while inspecting, so the page can still scroll when it is not.
  6. Lift by layer, not by clone or .visible. The piece moves to layer 1, the room renders on layer 0, a fullscreen quad at opacity 0.80 e goes between, clearDepth(), then layer 1. Lights need layers.enable(1) or the lifted piece renders black. The scene needs background = null and manual clear(); a scene background re-clears pass two.
  7. Perspective-true hand-off, no pop. Interpolate in camera space: x/z and y/z linearly, then multiply by the lerped depth. A world-space lerp slides in depth and the piece hardly moves sideways for the first 100 ms. The world "from" pose is stored, never re-read from the moving object, so a cancelled lift lands on the exact bench pose (verified equal to four decimals after Esc at 150 ms).
  8. Hold the camera in the hand; never chase it. The hand pose is defined in camera space; if the lean keeps easing while inspecting, the piece swims. Freeze it, resume on close.
  9. Sit at the band's middle, sized by it. `fit = min(0.92 bandH, 0.88 W) / (
자주 묻는 질문

클릭하면 카메라가 움직이나요?

아닙니다. 스킬은 카메라를 물체 주위로 돌리는 대신, 물체를 고정된 자리로 들어 올린다고 설명합니다.

방문자는 검사 화면을 어떻게 닫나요?

Esc 키, 물체 밖을 클릭하는 것, 또는 닫기 버튼으로 닫을 수 있습니다.

컨트롤 라이브러리가 필요한가요?

아닙니다. 스킬은 OrbitControls 라이브러리도, 맞춤 셰이더도 쓰지 않는다고 설명합니다.

상세 정보

작성자의 원본 설명

Make a 3D object lean around on hover and open a full inspect view on click. Hover is a damped, bounded camera lean; click lifts the piece off its bench into the hand, where you drag to turn it, coast, dolly with wheel or pinch, and put it back with Esc, click-away or a Close button. Use for product, object, joinery and portfolio pieces in Three.js where a hover orbit and click-to-full-view must not fight each other; use webgl-3d-object for a floating hero mesh with no inspect mode, and 3d-virtual-tour for a camera path through a place.

repo: MengTo/Skills

인기도

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

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬