feat: OpenStreetMap → walkable PSP streetscapes (city3d) + adventure3d floor fix#14
Draft
doodlewind wants to merge 2 commits into
Draft
feat: OpenStreetMap → walkable PSP streetscapes (city3d) + adventure3d floor fix#14doodlewind wants to merge 2 commits into
doodlewind wants to merge 2 commits into
Conversation
Turn a real place on Earth into a textured, walkable PSP 3D scene from OSM: - fetch-osm.ts (pure Bun) downloads Overpass data + vendors the ODbL source extract - bake-osm.ts projects lat/lon -> metres, extrudes building footprints (height from height/building:levels) into window-textured walls + earcut roofs, road ribbons and parks, merged into an NxN chunk grid split by texture (facade / pavement / flat) with two procedural REPEAT-wrapping textures, per-building collision AABBs and a spawn point - city3d.js loads it as static culled sub-meshes (one Material per texture), a sun + fog, an optional hand-modeled hero landmark, and a skinned soldier with camera-relative movement (the model turns to face the way it walks) + AABB collision - camera-following tessellated ground + skybox so the PSP GE guard band never drops a huge triangle (the "random black faces" bug) - locations: Paris/Etoile (Arc de Triomphe hero), Shanghai/Lujiazui (default), plus Times Square + Shibuya configs; swap by changing one import line - docs/osm-streetscape-research.md surveys the non-commercial data sources Verified on PPSSPP at ~60 FPS; bun run test 22/22 (city3d golden added). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…e arena The 38 m arena floor was one finite static slab; the chase camera sits 7 m behind the soldier, so near an edge the camera ends off the floor and the foreground had no geometry -> black void. Replace the static floor with the same camera-following tessellated ground city3d uses (one mesh, 8 m guard-band-safe tiles, edge past fog.far), so there is always floor under the view. Verified on PPSSPP at 60 FPS; golden regenerated, bun run test 22/22. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
5c6a85f to
5248c26
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A toolchain to bake any real-world location from OpenStreetMap into a textured, walkable PSP 3D scene, plus a fix for a related "black faces" rendering bug in
adventure3d.Built on the existing
g3dretained-mesh pipeline — no engine changes; it's all baker + game + assets.OSM streetscape (
feat(city3d))framework/bake/fetch-osm.ts— pure-Bun Overpass downloader (multi-endpoint fallback) that vendors the raw JSON underassets/vendor/osm/(the ODbL source extract, kept for reproducibility + ODbL §4.6).framework/bake/bake-osm.ts— projects lat/lon → metres, extrudes building footprints (height fromheight/building:levels) into window-textured walls + ear-clipped roofs, road ribbons and parks, merged into an N×N chunk grid split by texture (facade / pavement / untextured). Emits a base64assets-osm-*.tsmodule + per-building collision AABBs + a street spawn + two procedural REPEAT-wrapping textures.framework/games/city3d.js— loads the sub-meshes as static, culledNode3Ds (one sharedMaterialper texture), sun + fog, an optional hand-modeled hero landmark, and a skinned soldier with camera-relative movement (the model turns to face the way it walks) + AABB collision. The ground + skybox are small, camera-following tessellated meshes so the PSP GE guard band never drops a huge triangle.docs/osm-streetscape-research.md— survey of non-commercial 3D/geo data sources (raw OSM is the only legal offline path; photoreal 3D tiles are streaming-only).adventure3d floor fix (
fix(adventure3d))The 38 m arena floor was one finite static slab; the chase camera sits 7 m behind the soldier, so near an edge the camera ends off the floor → black void in the foreground. Replaced it with the same camera-following tessellated ground.
Verification
bun run test→ 22 passed, 0 failed (newcity3dgolden;adventure3dgolden regenerated).bun run typecheckclean.main@a3597e8).Notes / follow-ups
mipsel-sony-psp/SDK andruntime/target/stay gitignored.fps3d's 20 m room box is a latent case of the same finite-floor issue; not touched here.🤖 Generated with Claude Code