# Melonjs 3d Assets

Use this skill when loading 3D models into melonJS, glTF and GLB scenes, OBJ/MTL...

- Repository: https://github.com/melonjs/melonJS (6430 stars)
- Category: Design
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add melonjs/melonJS --skill melonjs-3d-assets -g -a claude-code -y`
Codex: `npx skills add melonjs/melonJS --skill melonjs-3d-assets -g -a codex -y`
Cursor: `npx skills add melonjs/melonJS --skill melonjs-3d-assets -g -a cursor -y`
Gemini CLI: `npx skills add melonjs/melonJS --skill melonjs-3d-assets -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add melonjs/melonJS`

## Description

Use this skill when loading 3D models into melonJS, glTF and GLB scenes, OBJ/MTL models, materials, imported lights, node animation, ground shadows and GPU instancing. Covers level.load options including the async flag, the rightHanded conversion, and exactly what the loader does and does not support. Triggers on: glTF, gltf, glb, OBJ, MTL, 3D model, getGLTF, getOBJ, getMTL, GLTFModel, GLTFScene, level.load glb, rightHanded, lightIntensityScale, castGroundShadow, shadowGroundY, EXT_mesh_gpu_instancing, KHR_lights_punctual, skinning, Blender export, 3D asset.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Loading 3D assets

> glTF/GLB is the primary path for 3D content, and it goes through the **level
> director** rather than the world directly: `level.load("scene")`, the same call
> a Tiled map uses. OBJ/MTL is the simpler path for a single static model.

## Loading a glTF/GLB scene

```js
await loader.preload([
    { name: "diorama", type: "glb", src: "data/scenes/diorama.glb" },
]);

level.load("diorama", { scale: 50 });
```

`type: "gltf"` (JSON plus external buffers) and `type: "glb"` (single binary)
are both loader types. A self-contained GLB is the better shipping format, one
request, nothing to resolve relatively.

The scene loads under whatever camera the stage has; view it under a `Camera3d`
or it renders flat. See `melonjs-3d` for the camera.

### `level.load` options for glTF/GLB

| option | default | what it does |
|---|---|---|
| `scale` | `1` | pixels per glTF unit, applied to the whole scene. Blender's metre-scale export usually needs 20, 100. |
| `container` | `game.world` | where the nodes are added |
| `onLoaded` | `game.onLevelLoaded` | called with the **level id**, not the scene |
| `async` | `false` | return a promise that settles once the scene is in the world, instead of a boolean |
| `rightHanded` | `true` | see below |
| `lights` | `true` | instantiate authored `KHR_lights_punctual` lights as `Light3d` world children |
| `lightIntensityScale` |, | keep authored intensity ratios instead of normalising every light to 1 |

Those `game.` defaults are the engine's, not a recommendation. `game` is
whichever `Application` finished `init()` last, so **pass `container`
explicitly** from a `Stage`, where the right one is in your hand:

The rest: https://github.com/melonjs/melonJS/blob/HEAD/packages/melonjs/skills/melonjs-3d-assets/SKILL.md
