3d-orbit-inspect-demo
ما الذي تفعله
توجّه هذه المهارة الوكيل خلال بناء عرض جسم ثلاثي الأبعاد بوضعين. وهي لمطورين ويب يصنعون قطعًا لمنتجات أو محافظ أو أعمال حرفية يستطيع الزوار استكشافها.
متى تستخدمها
- ✓عندما يجب أن يميل منتج ثلاثي الأبعاد برفق نحو الفأرة عند التمرير.
- ✓عندما يجب أن ينقر الزوار على الجسم ليمسكوه ويديروه.
- ✓عندما تريد عرض فحص يُغلق بمفتاح Esc أو زر إغلاق.
رابط المهارة
https://github.com/MengTo/Skills/blob/main/agent-skills/3d/3d-orbit-inspect-demo/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“اجعل منتجي ثلاثي الأبعاد يميل نحو المؤشر عند التمرير، وافتح عرض فحص كامل عند النقر.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
عند التمرير تميل الكاميرا برفق حول الجسم. وعند النقر يرتفع الجسم إلى موضع ثابت أمام الكاميرا، حيث يستطيع الزوار السحب لتدويره، ويغلقون العرض بـ 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.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) / (
الأسئلة الشائعة
هل تتحرك الكاميرا عند النقر؟
ترفع المهارة الجسم إلى موضع ثابت بدلًا من تحريك الكاميرا حوله.
كيف يغلق الزوار عرض الفحص؟
بمفتاح Esc، أو بالنقر خارج الجسم، أو بزر Close.
هل يحتاج إلى مكتبة للتحكم؟
لا. تنص المهارة على عدم استخدام مكتبة 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
- آخر تحديث
- 1/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
3d-cloth-material
7.2kيساعد وكيلك على بناء قماش منسوج واقعي في Three.js، مع نسيج الخيوط والبريق الناعم والثنيات الطبيعية والأطراف والدروز.
3d-falling-leaves
7.2kيساعد وكيلك على إضافة أوراق متساقطة واقعية إلى مشهد ثلاثي الأبعاد، تتقلب وتنجرف مع الريح وتُعاد تدويرها مع حركة الكاميرا.
3d-four-seasons
7.2kيساعد وكيلك على إضافة مظاهر الربيع والصيف والخريف والشتاء إلى مشهد ثلاثي الأبعاد، بتغيير النباتات والضوء والسماء والثلج دون إعادة بناء المشهد.
3d-high-poly-models
7.2kيساعد وكيلك على بناء نماذج ثلاثية الأبعاد مفصلة بأشكال ناعمة وحواف مقنعة، ثم تجهيز نسخ أخف تعمل جيدًا على الويب.
مهارات مشابهة
angular-developer
280kيساعد وكيلك على كتابة شيفرة Angular وتقديم نصائح لبنية المشروع، ويفيد في بدء المشاريع الجديدة وإنشاء المكونات وتحسين الأداء وإمكانية الوصول.
frontend-a11y
280kيساعد وكيلك على جعل واجهات الويب متاحة للجميع، فيضمن أن المواقع والتطبيقات تعمل جيدًا مع قارئات الشاشة والتنقل بلوحة المفاتيح.
frontend-patterns
280kيطبّق وكيلك أنماط تطوير الواجهات الحديثة، فيحسّن الأداء ويدير الحالة ويتبع أفضل الممارسات في React وNext.js.