threejs-core-scene-graph

Manage Three.js Object3D hierarchies with safe reparenting and traversal.

11|Updated Mar 20, 2026
One-click install
npx skills add https://github.com/OpenAEC-Foundation/Three.js-Claude-Skill-Package --skill threejs-core-scene-graph
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: threejs-core-scene-graph
Source: https://github.com/OpenAEC-Foundation/Three.js-Claude-Skill-Package/tree/main/skills/source/threejs-core/threejs-core-scene-graph
Command: npx skills add https://github.com/OpenAEC-Foundation/Three.js-Claude-Skill-Package --skill threejs-core-scene-graph

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Managing complex Three.js scenes requires clear structure of Object3D hierarchies, correct parent-child relationships, and reliable traversal. It also covers pitfalls like reparenting with add() vs attach(), disposal management, and matrix update patterns that can lead to subtle rendering bugs if ignored.

Core Features & Use Cases

  • Comprehensive reference for Object3D, Scene, Group, Mesh, and Layers, including traversal, coordinate conversion, and hierarchy management.
  • Demonstrates safe reparenting with attach(), proper disposal patterns, and layer-based visibility to optimize rendering.
  • Provides practical examples of hierarchical scene construction, reparenting scenarios, debugging helpers, and anti-patterns.

Quick Start

Create a simple scene with a parent Group and a child Mesh, then reparent the child to another Group using attach() to preserve its world position.

Frequently Asked Questions about threejs-core-scene-graph

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reparent a Three.js Object3D without changing its world position?

To reparent an Object3D without changing its world position in Three.js, use the attach() method instead of add(), which preserves the object's world matrix during the hierarchy transfer.

What is the difference between add() and attach() in Three.js scene graphs?

In Three.js scene graphs, add() simply appends an object to a new parent, altering its world position, while attach() safely reparents the object by recalculating its local matrix to maintain its exact world transformation.

How do I safely traverse a Three.js scene graph for disposal?

To safely traverse a Three.js scene graph for disposal, iterate through the Object3D hierarchy using traversal patterns, ensuring geometries and materials are deallocated to prevent memory leaks and subtle rendering bugs.

When should I use manual matrix updates in Three.js?

Use manual matrix updates in Three.js when you need precise control over Object3D transformations, bypassing automatic updates to optimize performance or implement predictable lookAt and coordinate conversion behaviors.

How do Layers work for rendering visibility in Three.js?

Layers in Three.js control rendering visibility by assigning Object3D instances to specific bitmasks, allowing cameras to toggle layer visibility and optimize rendering by excluding unnecessary scene graph branches.