full-stack-skills/threejs-skills

threejs-controls

Addon camera and object manipulation controls: OrbitControls, MapControls, FlyControls, FirstPersonControls, TrackballControls, ArcballControls, DragControls, PointerLockControls, TransformControls; damping, target focal point, and integration with the anim…

查看源码

使用方法

  1. 复制安装命令,在自己的智能体环境安装前先检查源码包。
  2. 从原始文档核对所需工具、凭据和支持的宿主。
  3. 说明输入材料与期望交付物,并对照来源检查输出。
npx skills add https://github.com/full-stack-skills/threejs-skills --skill threejs-controls

开始前需了解

  • 安装不包含模型订阅、API 额度或访问文件的权限。
  • 仓库星数和安装量反映活跃情况,不等于独立质量或安全测试。
仓库原始内容

按源仓库内容呈现,保留标题、案例、代码、表格、链接以及原文引用的演示图片。

When to use this skill

ALWAYS use this skill when the user mentions:

  • Orbiting/panning/dolly around a target, inertia/damping, min/max distance/polar angles
  • Map-like pan (MapControls) or flying (FlyControls)
  • Transform gizmo translate/rotate/scale with TransformControls
  • Dragging objects in plane (DragControls), pointer lock FPS (PointerLockControls)

IMPORTANT: controls vs webxr

ContextSkill
Desktop/browser camera navthreejs-controls
XR controller posesthreejs-webxr

Trigger phrases include:

  • "OrbitControls", "TransformControls", "MapControls", "PointerLockControls"
  • "轨道", "变换控制器", "漫游"

How to use this skill

  1. Import from addons path (threejs-dev-setup).
  2. Construct with (camera, domElement); for TransformControls also attach to renderer events.
  3. Animation loop: when enableDamping, call controls.update() each frame.
  4. TransformControls: wire dragging-changed to disable Orbit temporarily; sync with selection from threejs-objects.
  5. Constraints: set min/max distance/angles to avoid flipping or underground views.
  6. Dispose: controls.dispose() when tearing down.

See examples/workflow-orbit-damping.md.

Doc map (official)

Docs sectionRepresentative links
Controlshttps://threejs.org/docs/OrbitControls.html
Controlshttps://threejs.org/docs/TransformControls.html
Controlshttps://threejs.org/docs/MapControls.html
Controls (index)https://threejs.org/docs/#Controls

Scope

  • In scope: Official addons controls usage patterns.
  • Out of scope: Full physics character motor; mobile gesture frameworks.

Common pitfalls and best practices

  • Forgetting update() with damping enabled causes drift never settling.
  • TransformControls fighting with Orbit—pause one while using the other.
  • Pointer lock requires user gesture and exit handling.

Documentation and version

Controls are under Controls (Addons) in three.js docs. API details (enableDamping, events) evolve—link OrbitControls / TransformControls pages for the user’s three.js version.

Agent response checklist

When answering under this skill, prefer responses that:

  1. Link the specific controls class from the docs.
  2. State controls.update() when damping is on, every frame.
  3. Coordinate TransformControls with selection / threejs-objects raycasting.
  4. Separate desktop navigation from threejs-webxr locomotion.
  5. Call dispose() on controls when unmounting canvas.

References

  • https://threejs.org/docs/#Controls
  • https://threejs.org/docs/OrbitControls.html
  • https://threejs.org/docs/TransformControls.html

Keywords

English: orbitcontrols, transformcontrols, mapcontrols, damping, camera controls, three.js

中文: OrbitControls、轨道、TransformControls、变换控制器、阻尼、three.js

来自同一仓库

更多 Skills

全部 Skills
full-stack-skills
社区

threejs-audio

three.js audio spatialization: AudioListener attached to camera rig, Audio and PositionalAudio sources, AudioAnalyser for FFT/time-domain data, and integration with Web Audio API contexts; AudioLoader is referenced from threejs-loaders for file decoding. Use when placing 3D sound, configuring panner parameters, or visualization; not a replacement for full game audio middleware.

1小时安装量
3
GitHub Stars
14
最近更新
10月3日
full-stack-skills
社区

threejs-camera

three.js cameras: Camera base, PerspectiveCamera, OrthographicCamera, CubeCamera, ArrayCamera, StereoCamera; projection matrices, aspect, FOV, orthographic frustum sizes, near/far planes, and dynamic environment maps with CubeCamera. Use when placing views, rendering reflections, or multi-view splits; for XR projections and eye matrices use threejs-webxr; for post pass camera tricks use threejs-postprocessing alongside threejs-renderers.

1小时安装量
3
GitHub Stars
14
最近更新
10月3日
full-stack-skills
社区

threejs-dev-setup

Bootstrap and toolchain guidance for three.js applications using npm, Vite/Webpack/Rollup, bare ESM import maps, and TypeScript. Covers canonical import paths for three core versus three/addons/ (examples/jsm re-exports), version alignment with https://threejs.org/docs/, and fixing "module not found" for loaders and controls. Use when scaffolding a new 3D project, migrating bundler, or debugging resolution of addons—do not use for rendering API details (see threejs-renderers) or asset loading lo

1小时安装量
3
GitHub Stars
14
最近更新
10月3日
full-stack-skills
社区

threejs-geometries

three.js geometry authoring: BufferGeometry, typed BufferAttribute and interleaved layouts, InstancedBufferGeometry, primitive Geometries (box/sphere/torus/etc.), ExtrudeGeometry and Shape/Path/Curve from Extras, WireframeGeometry, and addon geometries such as TextGeometry, DecalGeometry, RoundedBoxGeometry. Covers merged scope of procedural curves and extrusion formerly split as extras-curves; for animation morph targets see threejs-animation; for merging buffers utilities see official BufferGe

1小时安装量
3
GitHub Stars
14
最近更新
10月3日