mcpField
T
threejs-objects

threejs-objects

github.com/full-stack-skillsDevelopment10374 installsUpdated 4w ago
Repository

About threejs-objects

threejs-objects is a skill for answering three.js scene-graph and object questions. It covers object transforms, mesh types, raycasting, layers, and object cleanup, with guidance for routing math-only and XR topics elsewhere.

Key features

  1. 01Scene graph and object transforms
  2. 02Static, instanced, and skinned meshes
  3. 03Raycasting and picking
  4. 04Layer-based visibility
  5. 05Object disposal guidance

Use cases

  1. 01Organizing objects with Group and transforms
  2. 02Selecting scene objects with Raycaster
  3. 03Filtering camera and object visibility by layers

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/full-stack-skills/threejs-skills --skill threejs-objects

After installing, type/threejs-objectsin Claude Code to confirm it loaded.

Bundled filesagents/openai.yamlexamples/workflow-raycaster-pick.md

Details

From the project README

When to use this skill

ALWAYS use this skill when the user mentions:

  • Parent/child relationships, position/rotation/scale, matrixAutoUpdate, updateMatrixWorld
  • Choosing mesh types: static vs instanced vs skinned vs batched LOD
  • Picking: Raycaster.setFromCamera, intersectObjects, recursive flag, face/uv results
  • Layers: selective visibility for cameras/lights/objects

IMPORTANT: objects vs math

NeedSkill
Scene graph + pickingthreejs-objects
Box/ray math onlythreejs-math

Trigger phrases include:

  • "Object3D", "InstancedMesh", "SkinnedMesh", "Raycaster", "layers"
  • "父子节点", "射线拾取", "图层"

How to use this skill

  1. Compose scenes with Group and transforms; minimize deep hierarchies where possible.
  2. Instancing: set per-instance matrices; understand count and frustum culling behavior.
  3. SkinnedMesh: bind skeleton; clips in threejs-animation; skinning material flags in threejs-materials.
  4. Picking: normalize device coords, set ray from camera, filter by layers, sort intersections.
  5. Events: EventDispatcher on custom objects—patterns only, not DOM frameworks.
  6. Clipping: ClippingGroup usage per docs when user needs sectional cuts.
  7. Dispose: geometries/materials/textures when removing objects permanently.

See examples/workflow-raycaster-pick.md.

Doc map (official)

Docs sectionRepresentative links
Corehttps://threejs.org/docs/Object3D.html
Objectshttps://threejs.org/docs/Mesh.html
Objectshttps://threejs.org/docs/InstancedMesh.html
Corehttps://threejs.org/docs/Raycaster.html

Scope

  • In scope: Object3D graph, renderable object types, raycasting, layers, dispatcher basics.
  • Out of scope: Physics engines; XR input mapping (threejs-webxr).

Common pitfalls and best practices

  • Forgetting updateMatrixWorld before world-space ray tests on moved objects.
  • Raycaster without layers set picks unintended objects—set masks consistently on camera and objects.
  • InstancedMesh raycast hits need per-instance handling—check docs for your version.

Documentation and version

Object3D, mesh types, Raycaster, and Layers are documented under Objects and Core in three.js docs. Behavior of picking and layers can shift slightly—link the exact page for the user’s three.js line.

Agent response checklist

When answering under this skill, prefer responses that:

  1. Link Object3D, Mesh, InstancedMesh, Raycaster, or Layers as needed.
  2. Pair skeletal animation with threejs-animation and skinned mesh setup.
  3. Route pure linear-algebra questions without a scene graph to threejs-math.
  4. Route XR input to threejs-webxr when sessions/controllers are involved.
  5. Mention dispose() for geometries/materials when removing objects permanently.

References

Keywords

English: object3d, mesh, instancedmesh, skinnedmesh, raycaster, layers, scene graph, three.js

中文: 场景图、Object3D、Mesh、实例化、骨骼网格、射线拾取、图层、three.js

Comments

Markdown supported