3d-orbit-inspect-demo
Ce qu’il fait
Cette compétence guide l'agent pour construire une vue d'objet 3D avec deux modes. Elle s'adresse aux développeurs web qui créent des produits, portfolios ou pièces artisanales que les visiteurs peuvent explorer.
Quand l’utiliser
- ✓Quand un produit 3D doit s'incliner doucement vers la souris au survol.
- ✓Quand les visiteurs doivent cliquer sur un objet pour le saisir et le faire pivoter.
- ✓Quand vous voulez une vue d'inspection qui se ferme avec la touche Échap ou un bouton de fermeture.
Lien du skill
https://github.com/MengTo/Skills/blob/main/agent-skills/3d/3d-orbit-inspect-demo/SKILL.mdCopiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.
Comment l’utiliser
Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.
Message prêt à coller
Pour Claude Code, Codex ou Cursor : lancez-la dans le dossier du projet et le skill est installé.
Téléchargez le SKILL.md et placez-le dans le dossier de skills de votre agent.
Exemple de demande à votre IA
“Fais en sorte que mon produit 3D s'incline vers le curseur au survol, et ouvre une vue d'inspection complète au clic.”
5 nouveaux skills par semaine. 1 minute de lecture.
Comment ça marche
Au survol, la caméra s'incline doucement autour de l'objet. Au clic, l'objet se place à un emplacement fixe devant la caméra, où les visiteurs peuvent le faire pivoter en le faisant glisser, et fermer la vue avec Échap ou un bouton de fermeture.
Contenu technique (SKILL.md original)
Texte original de l’auteur, en anglais, directement depuis 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) / (
Questions fréquentes
La caméra bouge-t-elle au clic ?
La compétence soulève l'objet vers un emplacement fixe au lieu de déplacer la caméra autour de lui.
Comment les visiteurs ferment-ils la vue d'inspection ?
Avec la touche Échap, un clic en dehors de l'objet, ou un bouton Fermer.
A-t-elle besoin d'une bibliothèque de contrôles ?
Non. La compétence indique qu'elle n'utilise ni la bibliothèque OrbitControls ni de shaders personnalisés.
Détails
Description originale de l’auteur
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
Popularité
- Étoiles GitHub
- 7.2k
- Position au classement
- #13319
- Licence
- MIT
- Mis à jour
- 01/11/2026
Commentaires
- …
Autres skills de ce dépôt
3d-cloth-material
7.2kAide votre agent à créer un tissu tissé réaliste dans Three.js, avec le tissage des fils, un léger brillant, des plis naturels, des ourlets et des coutures.
3d-falling-leaves
7.2kAide votre agent à ajouter des feuilles qui tombent de façon réaliste dans une scène 3D, qui tournoient, dérivent avec le vent et se recyclent quand la caméra bouge.
3d-four-seasons
7.2kAide votre agent à ajouter les looks printemps, été, automne et hiver à une scène 3D, en changeant le feuillage, la lumière, le ciel et la neige sans la reconstruire.
3d-high-poly-models
7.2kAide votre agent à construire des modèles 3D détaillés aux formes lisses, puis à préparer des versions légères qui tournent bien sur le web.
Skills similaires
angular-developer
280kAide votre agent à créer du code Angular et à conseiller sur la structure des projets. Utile pour démarrer, créer des composants ou améliorer performances et accessibilité.
frontend-a11y
280kAide votre agent à rendre les interfaces web accessibles à tous. Il garantit que sites et apps fonctionnent avec les lecteurs d'écran et la navigation au clavier.
frontend-patterns
280kPermet à votre agent d'appliquer les modèles modernes du frontend : optimisation des performances, gestion d'état et bonnes pratiques avec React et Next.js.