Skip to content

feat(graphics-3d): add model3D component with gltf loading - #44

Open
Tchips46 wants to merge 1 commit into
feat/graphics-3d-packagesfrom
feat/graphics-3d-model
Open

Tchips46 wants to merge 1 commit into
feat/graphics-3d-packagesfrom
feat/graphics-3d-model

Conversation

@Tchips46

Copy link
Copy Markdown
Member

Adds Model3D(path) to @nanoforge/graphics-3d: one component shows a .glb/.gltf model.

  • components/model-3d.ts: path is tagged @asset .glb .gltf for the editor, @side client.
  • model-loader.ts: loadModel3D loads the file with ctx.assets.getAsset(path) and GLTFLoader (three/addons) in the background, so it never blocks init.
    • A missing or broken file logs console.error with the path and shows a magenta placeholder box. It never throws.
    • A load that finishes after the component was removed adds nothing to the scene and disposes what it loaded.
  • draw3D / toObject3D: toObject3D gives an empty Group that draw3D fills, placed by Position3D/Rotation3D/Scale3D. A new path gives a new group, so the model reloads. On remove, disposeObject3D frees the model's geometries, materials and textures.

@Tchips46
Tchips46 changed the base branch from main to feat/graphics-3d-packages November 26, 2026 10:33
@Tchips46 Tchips46 changed the title Feat/graphics 3d model feat(graphics-3d): add model3D component with gltf loading Nov 26, 2026
@Tchips46 Tchips46 changed the title feat(graphics-3d): add model3D component with gltf loading feat(graphics-3d): add model3D component with gltf loading Nov 26, 2026
@Exeloo
Exeloo added this pull request to stack #46 November 26, 2026 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants