尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证制作者的介绍仅有上面的一句话。 更多详情请阅读仓库 README。 仓库 README ↗
正在加载完整 README。
查看完整 README ↗Railgrid · Kelana Jaya: an interactive 3D control-room dashboard for KJ24 Kelana Jaya LRT station (Kelana Jaya Line, Petaling Jaya, Selangor), built with Three.js.
It renders the elevated station, viaduct, roads, feeder bus hub and Park & Ride in 3D. Driverless 4-car trains run on both tracks, passengers build up on the platforms, and buses come and go. Live panels show station KPIs, train status, crowding, facilities and alerts.
Live demo: https://lrt-3d-simulation.vercel.app
All data is simulated. Nothing is pulled from Rapid KL or any live feed. The timetable, ridership and facility faults are generated in the browser so the demo has something realistic to show.
vendor/, so no CDN is needed.The app is a single HTML file, but it must be served over HTTP. Browsers block ES-module imports from file://, so double-clicking the HTML file shows a blank page.
# 1. Clone the repo
git clone https://github.com/Thilak7c/lrt-3d-simulation.git
cd lrt-3d-simulation
# 2. Start a local web server
python -m http.server 8000
Then open http://localhost:8000/railgrid-kelana-jaya.html in your browser.
Press Ctrl+C in the terminal to stop the server.
npx serve .
Open the URL it prints and click railgrid-kelana-jaya.html.
Install the Live Server extension, right-click railgrid-kelana-jaya.html and choose Open with Live Server.
| Action | Mouse / touch |
|---|---|
| Pan | Left-drag (one-finger drag on touch) |
| Rotate / tilt | Right-drag (two-finger rotate on touch) |
| Zoom | Scroll wheel / pinch |
| Select an object | Click it (the cursor turns into a pointer over clickable things) |
The toolbar on the left side of the map has buttons for: zoom in / out, rotate left / right, reset view and cinematic orbit.
When you zoom in close, the station roof fades out so you can see the platform.
| Key | Action |
|---|---|
/ | Focus the search box |
Enter (in search) | Jump to the first result |
Esc | Clear search and close any open pop-up |
KJ24 Kelana Jaya): jump to any area of the station.Everything runs client-side in railgrid-kelana-jaya.html.
DEM) runs from 0 to 1 by hour. It peaks around 07:00–09:30 and 17:00–20:00.headway()). Trains get small random delays, which feed the on-time KPI and late-arrival alerts.ENTRY_RATE × demand, wait on the platform, and board or alight when a train dwells. Crowding thresholds:
FAC). Fare gate 12 is deliberately faulty to show how alerts look.rng(2024)) makes the layout and starting state the same on every load.The code points out where real data could be plugged in. For example, the headway is marked as a shortcut to replace with a real GTFS feed.
lrt-3d-simulation/
├── railgrid-kelana-jaya.html # The whole app: HTML, CSS and JS (ES module)
├── vendor/
│ └── three/ # Local copy of [email protected] (only the files used)
│ ├── build/
│ │ └── three.module.js
│ └── examples/jsm/
│ ├── controls/ # MapControls.js, OrbitControls.js
│ ├── lines/ # LineSegments2.js, LineSegmentsGeometry.js, LineMaterial.js
│ ├── renderers/ # CSS2DRenderer.js
│ └── utils/ # BufferGeometryUtils.js
├── docs/
│ └── screenshot.png # Screenshot used in this README
├── vercel.json # Serves the app at the site root on Vercel
└── README.md
railgrid-kelana-jaya.htmlThe script is split into sections with banner comments (/* ==== ... ==== */). In order:
MapControls, lighting and shadows.mergeGeometries) to keep draw calls low.Three.js is loaded through an import map that points at the local vendor/ folder:
<script type="importmap">
{"imports":{"three":"./vendor/three/build/three.module.js","three/addons/":"./vendor/three/examples/jsm/"}}
</script>
So the app runs with no internet connection, as long as you serve it from a local server (see Quick start).
The only online resource left is the Inter font from Google Fonts. Offline, the browser falls back to a system font and everything else works the same.
If you move the HTML file, keep the vendor/ folder next to it.
Download the same set of files for the new version from https://cdn.jsdelivr.net/npm/three@<version>/... into vendor/three/.
Check each add-on's own import lines, since add-ons can depend on other add-ons. For example, MapControls.js needs OrbitControls.js.
Newer versions (r171+) also split the core into three.core.js, which must be downloaded too.
The app is a static site, so any static host works. It is deployed on Vercel:
npm i -g vercel # once
vercel login # once
vercel deploy --prod
vercel.json rewrites / to railgrid-kelana-jaya.html, so the site root opens the simulation. No build step or framework setting is needed.
| What | Where (search for it in the HTML) |
|---|---|
| Peak / off-peak headway | const headway= |
| Ridership curve by hour | const DEM= |
| Passenger entry rate | const ENTRY_RATE= |
| Facility list and faults | const FAC= |
| Neighbouring stations in the tracker | const STNS= |
| Initial camera position | const HOME= |
| Colours | const C= |
| Problem | Fix |
|---|---|
| Blank page / stuck on "Loading…" | You opened the file via file://. Serve it with a local server instead (see Quick start). |
| Blank page while served | Open DevTools (F12) → Console. A 404 on vendor/... means the vendor/ folder is missing or in the wrong place. |
Address already in use | Port 8000 is taken. Use another port: python -m http.server 8080. |
| Changes not showing | Hard refresh with Ctrl+Shift+R. |
| Low frame rate | Close other GPU-heavy tabs, or make the browser window smaller. The shadow map is 4096², which is the main GPU cost. |
| Font looks different | You're offline, so Inter can't load and a system font is used. This is expected. |
MapControls, CSS2DRenderer, fat lines (LineSegments2).npm install.