threejs-objects

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

When to use this skill

何时使用此 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"
  • "父子节点", "射线拾取", "图层"
当用户提到以下内容时,始终使用此 skill:
  • 父子关系、
    position/rotation/scale
    、
    matrixAutoUpdate
    、
    updateMatrixWorld
  • 选择网格类型:静态 vs 实例化 vs 骨骼 vs 批量 LOD
  • 拾取:
    Raycaster.setFromCamera
    、
    intersectObjects
    、递归标志、面/UV 结果
  • 图层:相机/灯光/物体的选择性可见性
重要提示:物体 vs 数学
需求Skill
场景图 + 拾取threejs-objects
仅包围盒/射线数学threejs-math
触发短语包括:
  • "Object3D", "InstancedMesh", "SkinnedMesh", "Raycaster", "layers"
  • "父子节点", "射线拾取", "图层"

How to use this skill

如何使用此 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.
  1. 组合场景时使用
    Group
    和变换;尽量最小化深层层级。
  2. 实例化:设置每个实例的矩阵;理解
    count
    和视锥体裁剪行为。
  3. SkinnedMesh:绑定骨骼;动画片段在 threejs-animation 中;蒙皮材质标志在 threejs-materials 中。
  4. 拾取:标准化设备坐标,从相机设置射线,按图层过滤,对交点排序。
  5. 事件:在自定义对象上使用
    EventDispatcher
    ——仅模式,非 DOM 框架。
  6. 裁剪:当用户需要剖面切割时,按文档使用
    ClippingGroup
    。
  7. 释放:永久移除对象时,释放几何体/材质/纹理。
参见 examples/workflow-raycaster-pick.md。

Doc map (official)

文档映射(官方)

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
    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.
  • 在移动对象上进行世界空间射线测试前,忘记调用
    updateMatrixWorld
    。
  • 未设置
    layers
    的 Raycaster 会拾取意外对象——在相机和对象上一致设置掩码。
  • InstancedMesh 的射线投射命中需要按实例处理——请查阅您版本的文档。

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.
Object3D
、网格类型、
Raycaster
和
Layers
在 three.js docs 的 Objects 和 Core 部分中有文档。拾取和图层的行为可能略有变化——请为用户指定的 three.js 版本链接到确切页面。

Agent response checklist

Agent 响应清单

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.
在此 skill 下回答时,倾向于:
  1. 根据需要链接
    Object3D
    、
    Mesh
    、
    InstancedMesh
    、
    Raycaster
    或
    Layers
    。
  2. 将骨骼动画与 threejs-animation 和蒙皮网格设置配对。
  3. 将不涉及场景图的纯线性代数问题路由到 threejs-math。
  4. 当涉及会话/控制器时,将 XR 输入路由到 threejs-webxr。
  5. 永久移除对象时,提及对几何体/材质调用
    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