Lidar
A virtual reality game about escaping a maze you cannot see, using a lidar to scan your surroundings.

At a glance
- JavaScript
Tags
A virtual reality game where you have to find your way out of a maze you cannot see: you use your lidar, a laser coupled with a light sensor, to scan your surroundings and avoid obstacles.
It is inspired by the Garry's Mod addon LIDAR by datæ, and is still in early development: playable, with many features missing.
The idea
In the addon, nothing that moves can be seen until the player has scanned it, which makes for a powerful horror mechanic, especially in VR where the scale of the space is so obvious. Lidar is also a real technology, used in autonomous vehicles, robotics and medicine: a pulsed laser and a sensor that measures the time the reflected light takes to come back, usually on a rotating platform to cover 360 degrees.
In the game, the module sits on the player's controller. An array of lasers is fired from it, and each pulse produces a low-resolution depth map. Combined with where the controller points, these build a point cloud of the maze, denser where you scanned close and sparser further away.
Playing
Point the right controller at a surface and squeeze the trigger to scan, release to stop. The maze is about 40 by 40 metres, and movement is not implemented yet, so you can only scan the part within reach.
Under the hood
It runs in the browser, written in TypeScript with React, Joy UI and Three.js for WebGL and WebXR. Points are kept in a fixed-length vertex buffer of 100,000 points, drawn as a point cloud. The ray casting that finds where each laser lands is accelerated with three-mesh-bvh, which keeps it fast on intricate meshes.

