Skip to content

feat: render live players as 3D skinned models#792

Open
Apezdr wants to merge 1 commit intoBlueMap-Minecraft:masterfrom
Apezdr:feat/player-3d-model
Open

feat: render live players as 3D skinned models#792
Apezdr wants to merge 1 commit intoBlueMap-Minecraft:masterfrom
Apezdr:feat/player-3d-model

Conversation

@Apezdr
Copy link
Copy Markdown

@Apezdr Apezdr commented Apr 25, 2026

Closes #95

Summary

image image
  • 3D player model: replaces the 2D face-icon marker with a full skinview3d PlayerObject that renders the player's complete Minecraft skin including arms, legs, and head
  • Skin texture: server saves the full 64×64 skin PNG to playerskins/{uuid}.png; frontend loads it via loadSkinToCanvas with dimension validation and a Steve fallback; Steve/Alex model type is auto-detected via inferModelType
  • Cape support: server fetches the player's cape from Mojang (if any) and saves it to playercapes/{uuid}.png; the live player JSON now includes hasCape so the frontend only requests the cape texture when one actually exists — no 404 console noise for players without capes
  • Correct positioning: model is lifted 1 block (position.y = 1.0) so feet sit at ground level; head tilts with pitch, body rotates with yaw each frame
  • Lighting fix: BlueMap uses custom GLSL shaders rather than Three.js scene lights, so skinview3d's MeshStandardMaterial rendered black; swapped to MeshBasicMaterial after construction while preserving the skin.map / modelType setters

Test plan

  • Join the server and verify the 3D model appears at player position with correct skin
  • Walk/run and confirm yaw rotation tracks facing direction
  • Look up/down and confirm head pitch follows
  • Jump and confirm model stays fully above ground (no clipping)
  • Verify players without a cape show no cape and produce no 404 errors in the browser console
  • Verify players with a Mojang cape show it correctly
  • Verify Steve fallback skin renders when playerskins/ asset is unavailable

Replace the 2D face-icon player marker with a full 3D skinview3d
PlayerObject, complete with skin texture, yaw/pitch rotation, and
optional cape support.

Server-side (Java):
- PlayerSkinUpdater: save full 64×64 skin to playerskins/{uuid}.png
  alongside the existing face-crop playerheads/{uuid}.png; also fetch
  and save the player's cape (if any) to playercapes/{uuid}.png using a
  second Mojang session-server call; maintain a playersWithCapes set so
  cape existence is known without a filesystem hit
- LivePlayersDataSupplier: accept a capeChecker predicate and emit a
  hasCape boolean per player in the live JSON feed
- Plugin: wire skinUpdater::hasCape into LivePlayersDataSupplier

Frontend (JS/webapp):
- PlayerMarker: swap in skinview3d PlayerObject (scale 1/16, y+1 offset
  so feet sit at ground level); replace MeshStandardMaterial with
  MeshBasicMaterial (BlueMap has no Three.js scene lights); load skin
  via loadSkinToCanvas/CanvasTexture with dimension validation and
  steve_skin.png fallback; apply yaw to body and pitch to head each
  frame; load cape only when server confirms hasCape=true (avoids 404
  console noise for players without capes)
- PlayerMarkerSet: construct playerskins/ and playercapes/ URLs from the
  playerheads base URL and pass them to PlayerMarker
- Add public/assets/steve_skin.png: proper 64×64 RGBA Steve skin
  (extracted from Minecraft client JAR) as default fallback
- Add skinview3d ^3.4.1 dependency

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

Add player models (player live positions)

1 participant