How gniziemazity/virtual-world works
Virtual-world is a sequence of standalone JavaScript demos that build toward a self-driving-car simulation in an editable, rendered road world. The progression starts with spatial graphs and interactive editing, then adds viewport navigation, procedural roads and scenery, fake 3D, road markings and world saving; later demos integrate those capabilities with cars, sensors, traffic and neural-network visualization. The shown integration entry point loads a world, runs a car population and renders the best car. MiniMap adds a separate map view. Source excerpts are partial, so unsampled subsystem links are omitted where their runtime wiring is not evidenced.
Main entry points: 9. Integration/main.js Simulation entry · 11. MiniMap/main.js MiniMap simulation · world.js Road geometry · car.js Cars and sensors
Components 19
Graph and editing
- Spatial graph
1. Spatial Graphs/js/math/graph.js - Graph editor
2. Graph Editor/js/graphEditor.js
World construction
- Road geometry
4. Roads/js/world.js - Buildings and trees
5. Buildings And Trees/js/world.js - OSM world
10. OpenStreetMap/world/js/world.js - OSM conversion
10. OpenStreetMap/world/js/math/osm.js
World authoring
- Road markings
7. Markings/js/world.js - World persistence
8. Saving The World/js/world.js - Browser storage
Driving simulation
- Simulation entry
9. Integration/main.js - Cars and sensors
9. Integration/car.js - Traffic network
9. Integration/network.js - MiniMap simulation
11. MiniMap/main.js
Rendering and maps
- Dynamic viewport
3. Dynamic Viewport/js/viewport.js - Fake 3D rendering
6. Fake 3D/js/world.js - Network visualizer
9. Integration/visualizer.js - OSM map view
10. OpenStreetMap/miniMap.js - MiniMap view
11. MiniMap/miniMap.js
Other components
- User
Connections 20
- User → Graph editor: edits graph
- Graph editor → Spatial graph: updates graph
- Spatial graph → Road geometry: defines roads
- Road geometry → Buildings and trees: adds scenery
- Buildings and trees → Fake 3D rendering: renders depth
- Road geometry → Road markings: adds markings
- Road markings → World persistence: saves world
- User → Simulation entry: runs simulation
- Simulation entry → World persistence: loads world
9. Integration/main.js - Simulation entry → Cars and sensors: creates cars
9. Integration/main.js - Simulation entry → Dynamic viewport: follows best car
9. Integration/main.js - Simulation entry → Network visualizer: draws network
9. Integration/main.js - Simulation entry → Browser storage: reads and writes
9. Integration/main.js - Cars and sensors → Traffic network: uses sensors
- User → OSM conversion: imports map data
- OSM conversion → OSM world: builds world
- MiniMap simulation → MiniMap view: updates map
11. MiniMap/main.js - MiniMap simulation → Cars and sensors: runs cars
- MiniMap simulation → Network visualizer: draws network
11. MiniMap/main.js - MiniMap simulation → OSM map view: optional map view