Laser Grid 激光网格
Horizontal lines that get closer together as they approach the horizon — a fake 3D floor made of one loop. 横线越靠近地平线越密——一个循环就够了,是假 3D 地面。
Runs live on this page. Move the pointer, click, or drag — whichever the effect listens for. 就在本页实时运行。移动鼠标、点击或拖拽——看它响应哪一种。
How it works原理拆解
Each line's depth z cycles 0–800 via modulo, and the projected position uses 300/(z+1): as z grows the value collapses toward zero, squeezing lines against the horizon. The vertical fan is drawn separately with fixed angles, so only the horizontal rungs actually move. 每条线的深度 z 用取模在 0–800 之间循环,投影位置用 300/(z+1):z 越大结果越趋近 0,横线就被挤向地平线。纵向的扇形是另画一遍、角度固定的,所以真正在动的只有横向的踏板。
What to change可以改的地方
- 1Change 300 to 800 for a flatter, more distant horizon.
- 2Add glow on every eighth rung to suggest a lit runway.
- 1300 改成 800,地平线会更远、更平。
- 2每第八条横线加发光,就像一条点亮的跑道。
Source code源码
Self-contained — paste it into any HTML file and it runs. No libraries. 完全独立——粘进任意 HTML 文件就能跑,不需要任何库。