3d-orbit-inspect-demo
O que ela faz
Esta skill orienta o agente a criar uma visualização de objeto 3D com dois modos. Ela serve para desenvolvedores web que fazem peças de produto, portfólio ou artesanato que os visitantes podem explorar.
Quando usar
- ✓Quando um produto 3D deve se inclinar suavemente em direção ao mouse ao passar o cursor.
- ✓Quando os visitantes devem clicar em um objeto para pegá-lo e girá-lo.
- ✓Quando você quer uma visão de inspeção que fecha com a tecla Esc ou um botão de fechar.
Link da skill
https://github.com/MengTo/Skills/blob/main/agent-skills/3d/3d-orbit-inspect-demo/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Faça meu produto 3D se inclinar em direção ao cursor ao passar o mouse e abrir uma visão de inspeção completa ao clicar.”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
Ao passar o mouse, a câmera se inclina suavemente em torno do objeto. Ao clicar, o objeto sobe para um ponto fixo em frente à câmera, onde o visitante pode arrastar para girá-lo e fechar a visão com Esc ou um botão de fechar.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do 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.4lift ease; 1.0 s in, 0.60 s home, 0.28 s fast close; the way home straightens before it descends (sstep(0,.36)thensstep(.24,1)); drag 0.0085 / 0.0065 rad per px; spin dampingexp(-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 usesACESFilmicand 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
- 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.
- Gain from a raycast, target from the pointer relative to the piece.
grises to 1 only while the ray hits (tau 0.30 s); the target isclamp((pointer - pieceCentre)/(0.18 W), -1, 1). Screen-centre pointer maps make the piece drift whenever the mouse is anywhere on the page. - 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. - Hover is the last pointer, not a media query.
(hover:hover)lies on hybrid laptops and headless Chrome. ReadpointerTypeonpointermove; touch gets a slow sway (±0.6 of the bound at 0.55 rad/s) so the depth is still shown without hover. - 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:noneon the canvas only while inspecting, so the page can still scroll when it is not. - Lift by layer, not by clone or
.visible. The piece moves to layer 1, the room renders on layer 0, a fullscreen quad at opacity0.80 egoes between,clearDepth(), then layer 1. Lights needlayers.enable(1)or the lifted piece renders black. The scene needsbackground = nulland manualclear(); a scene background re-clears pass two. - Perspective-true hand-off, no pop. Interpolate in camera space:
x/zandy/zlinearly, 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). - 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.
- Sit at the band's middle, sized by it. `fit = min(0.92 bandH, 0.88 W) / (
Perguntas frequentes
A câmera se move ao clicar?
A skill levanta o objeto para um ponto fixo, em vez de mover a câmera ao redor dele.
Como os visitantes fecham a visão de inspeção?
Com a tecla Esc, um clique fora do objeto ou um botão Fechar.
Precisa de uma biblioteca de controles?
Não. A skill diz que não usa a biblioteca OrbitControls nem shaders personalizados.
Detalhes
Descrição original do autor
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
Popularidade
- Estrelas no GitHub
- 7,2 mil
- Posição no ranking
- #13319
- Licença
- MIT
- Atualizada em
- 01/11/2026
Comentários
- …
Mais skills deste repositório
3d-cloth-material
7,2 milAjuda seu agente a criar tecido tramado realista no Three.js, com trama de fios, brilho suave, dobras naturais, barras e costuras.
3d-falling-leaves
7,2 milAjuda seu agente a acrescentar folhas caindo realistas a uma cena 3D, com folhas que giram, são levadas pelo vento e reaproveitadas conforme a câmera se move.
3d-four-seasons
7,2 milAjuda seu agente a acrescentar visuais de primavera, verão, outono e inverno a uma cena 3D, alterando folhagem, luz, céu e neve sem reconstruir a cena.
3d-high-poly-models
7,2 milAjuda seu agente a criar modelos 3D detalhados com formas suaves e bordas convincentes, e depois preparar versões mais leves que rodem bem na web.
Skills parecidas
angular-developer
280 milAjuda seu agente a criar código Angular e a dar conselhos sobre a estrutura do projeto. É útil para iniciar novos projetos, criar partes do código ou melhorar a performance e acessibilidade.
frontend-a11y
280 milAjuda seu agente a tornar interfaces web acessíveis para todos. Ele garante que sites e apps funcionem bem com leitores de tela e navegação por teclado.
frontend-patterns
280 milFaz seu agente aplicar padrões modernos no desenvolvimento frontend. Ele otimiza performance, gerencia estado e segue boas práticas em React e Next.js.