Interactive 3D viewport that renders Cobblemon Bedrock models (.geo.json) with their textures and overlay layers. Pass a species and aspects — the resolver automatically selects the right model, base texture, and any emissive or translucent overlays. Drag to rotate · scroll to zoom · auto-rotates.
Resolver system
Resolver JSON files in public/cobblemon/bedrock/pokemon/resolvers/ map aspect combinations to models and textures. Each resolver has an order field; multiple resolvers per species are loaded and sorted by it (lowest = highest priority). Variation matching requires all listed aspects to be present in the active set, preferring more specific matches (more aspects = higher score), with resolver order as a tiebreaker. Layers are typed as emissive, translucent, or emissive + additive (a 0–1 strength number), each resolved to a public URL via cobblemon: namespace stripping.
Bedrock geometry loader
A custom loader parses .geo.json without any third-party Bedrock library:
- Coordinate mapping — Minecraft
+Z southmaps to Three.js−Z, so all Z positions are negated. Bone rotations use(+rx, −ry, −rz)with ZYX Euler order to match Blockbench's internal Z-negated frame (conjugated by an implicit Y180 flip relative to Blockbench's own loader). - Bone hierarchy — each bone becomes a
THREE.Grouppositioned at its pivot. Cube meshes are offset by−pivotso their vertices land at model-space coordinates regardless of nesting depth. Cube-level rotations get their own wrapper group positioned at the cube pivot. - Box-UV unfolding — the side strip follows
[west][front][east][back]order (not the Java skin convention). Bottom-face UV winding is corrected by forcingBL = (x1, z1)and inverting theflipUflag relative to the other faces. mirror_uv— mirrors east/west rects AND flips the U axis on all six faces, matching Blockbench's source behavior. Used on mirrored cubes like Pidgeot's wings and eyes.- Per-face UV — per-face
uv/uv_sizespecs are supported alongside box-UV;inflatepads all six faces outward.
Material and layer blending
Geometry is built once and shared across the base and all overlay layers — only materials differ. Layer blending:
- Base —
alphaTestcutout, depth write enabled. - Emissive — full-bright (not additive);
NormalBlendingwith cutout alpha and no depth write.MeshBasicMaterialis already unlit, soAdditiveBlendingwould only saturate toward white. - Emissive +
additive: <number>—AdditiveBlendingwithopacityset to the 0–1 strength value, scaling how much the layer adds to the scene.opacitymultiplies the source alpha before the GPU blend equation, so it's a direct brightness control with no shader changes needed. Used for Lapras's crystal tips (0.6). - Translucent —
NormalBlendingwith full alpha channel, no depth write.