threejs-objects
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWhen to use this skill
何时使用此 skill
ALWAYS use this skill when the user mentions:
- Parent/child relationships, ,
position/rotation/scale,matrixAutoUpdateupdateMatrixWorld - Choosing mesh types: static vs instanced vs skinned vs batched LOD
- Picking: ,
Raycaster.setFromCamera, recursive flag, face/uv resultsintersectObjects - 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"
- "父子节点", "射线拾取", "图层"
当用户提到以下内容时,始终使用此 skill:
- 父子关系、、
position/rotation/scale、matrixAutoUpdateupdateMatrixWorld - 选择网格类型:静态 vs 实例化 vs 骨骼 vs 批量 LOD
- 拾取:、
Raycaster.setFromCamera、递归标志、面/UV 结果intersectObjects - 图层:相机/灯光/物体的选择性可见性
重要提示:物体 vs 数学
| 需求 | Skill |
|---|---|
| 场景图 + 拾取 | threejs-objects |
| 仅包围盒/射线数学 | threejs-math |
触发短语包括:
- "Object3D", "InstancedMesh", "SkinnedMesh", "Raycaster", "layers"
- "父子节点", "射线拾取", "图层"
How to use this skill
如何使用此 skill
- Compose scenes with and transforms; minimize deep hierarchies where possible.
Group - Instancing: set per-instance matrices; understand and frustum culling behavior.
count - 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: on custom objects—patterns only, not DOM frameworks.
EventDispatcher - Clipping: usage per docs when user needs sectional cuts.
ClippingGroup - Dispose: geometries/materials/textures when removing objects permanently.
See examples/workflow-raycaster-pick.md.
- 组合场景时使用 和变换;尽量最小化深层层级。
Group - 实例化:设置每个实例的矩阵;理解 和视锥体裁剪行为。
count - SkinnedMesh:绑定骨骼;动画片段在 threejs-animation 中;蒙皮材质标志在 threejs-materials 中。
- 拾取:标准化设备坐标,从相机设置射线,按图层过滤,对交点排序。
- 事件:在自定义对象上使用 ——仅模式,非 DOM 框架。
EventDispatcher - 裁剪:当用户需要剖面切割时,按文档使用 。
ClippingGroup - 释放:永久移除对象时,释放几何体/材质/纹理。
参见 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).
- 在范围内: Object3D 图、可渲染对象类型、射线投射、图层、调度器基础。
- 不在范围内: 物理引擎;XR 输入映射(threejs-webxr)。
Common pitfalls and best practices
常见陷阱和最佳实践
- Forgetting before world-space ray tests on moved objects.
updateMatrixWorld - Raycaster without set picks unintended objects—set masks consistently on camera and objects.
layers - InstancedMesh raycast hits need per-instance handling—check docs for your version.
- 在移动对象上进行世界空间射线测试前,忘记调用 。
updateMatrixWorld - 未设置 的 Raycaster 会拾取意外对象——在相机和对象上一致设置掩码。
layers - InstancedMesh 的射线投射命中需要按实例处理——请查阅您版本的文档。
Documentation and version
文档和版本
Object3DRaycasterLayersObject3DRaycasterLayersAgent response checklist
Agent 响应清单
When answering under this skill, prefer responses that:
- Link ,
Object3D,Mesh,InstancedMesh, orRaycasteras needed.Layers - 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 for geometries/materials when removing objects permanently.
dispose()
在此 skill 下回答时,倾向于:
- 根据需要链接 、
Object3D、Mesh、InstancedMesh或Raycaster。Layers - 将骨骼动画与 threejs-animation 和蒙皮网格设置配对。
- 将不涉及场景图的纯线性代数问题路由到 threejs-math。
- 当涉及会话/控制器时,将 XR 输入路由到 threejs-webxr。
- 永久移除对象时,提及对几何体/材质调用 。
dispose()
References
参考
Keywords
关键词
English: object3d, mesh, instancedmesh, skinnedmesh, raycaster, layers, scene graph, three.js
中文: 场景图、Object3D、Mesh、实例化、骨骼网格、射线拾取、图层、three.js
英文: object3d, mesh, instancedmesh, skinnedmesh, raycaster, layers, scene graph, three.js
中文: 场景图、Object3D、Mesh、实例化、骨骼网格、射线拾取、图层、three.js