threejs-objects
Skill9 starsChanged 54 days agoApache-2.0View on GitHub
three.js scene graph objects: Object3D transforms and hierarchy, Group, Mesh, InstancedMesh, SkinnedMesh, BatchedMesh, LOD, Line/LineLoop/LineSegments, Points, Sprite, Bone, Skeleton, ClippingGroup; interaction via Raycaster, Layers masks, and EventDispatcher patterns. Merges the former interaction scope—use for picking and layers; for pure vector math without scene graph use threejs-math; for playing skeletal clips use threejs-animation; for frustum culling internals see camera docs.
In this repository21 other files it gives its agents.
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-exploreSkill
- openspec-proposeSkill
- threejs-animationSkill
- threejs-audioSkill
- threejs-cameraSkill
- threejs-controlsSkill
- threejs-dev-setupSkill
- threejs-geometriesSkill
- threejs-helpersSkill
- threejs-lightsSkill
- threejs-loadersSkill
- threejs-materialsSkill
- threejs-mathSkill
- threejs-node-tslSkill
- threejs-postprocessingSkill
- threejs-renderersSkill
- threejs-scenesSkill
- threejs-texturesSkill
- threejs-webxrSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 65
When answering under this skill, prefer responses that:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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
| Need | Skill |
| Scene graph + picking | threejs-objects |
| Box/ray math only | threejs-math |
Trigger phrases include:
- "Object3D", "InstancedMesh", "SkinnedMesh", "Raycaster", "layers"
- "父子节点", "射线拾取", "图层"
How to use this skill
- Compose scenes with
Groupand transforms; minimize deep hierarchies where possible. - Instancing: set per-instance matrices; understand
countand frustum culling behavior. - SkinnedMesh: bind skeleton; clips in threejs-animation; skinning material flags in threejs-materials.
- Picking: normalize device coords, set ray from camera, filter by layers, sort intersections.
- Events:
EventDispatcheron custom objects—patterns only, not DOM frameworks. - Clipping:
ClippingGroupusage per docs when user needs sectional cuts. - Dispose: geometries/materials/textures when removing objects permanently.
See examples/workflow-raycaster-pick.md.
Doc map (official)
| Docs section | Representative links |
| Core | https://threejs.org/docs/Object3D.html |
| Objects | https://threejs.org/docs/Mesh.html |
| Objects | https://threejs.org/docs/InstancedMesh.html |
| Core | https://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
updateMatrixWorldbefore world-space ray tests on moved objects. - Raycaster without
layersset 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:
- Link
Object3D,Mesh,InstancedMesh,Raycaster, orLayersas needed. - Pair skeletal animation with threejs-animation and skinned mesh setup.
- Route pure linear-algebra questions without a scene graph to threejs-math.
- Route XR input to threejs-webxr when sessions/controllers are involved.
- Mention
dispose()for geometries/materials when removing objects permanently.
References
- https://threejs.org/docs/Object3D.html
- https://threejs.org/docs/Raycaster.html
- https://threejs.org/docs/Layers.html
- https://threejs.org/docs/InstancedMesh.html
Keywords
English: object3d, mesh, instancedmesh, skinnedmesh, raycaster, layers, scene graph, three.js
中文: 场景图、Object3D、Mesh、实例化、骨骼网格、射线拾取、图层、three.js
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

