← All projects

CAVE Simulation

Immersive virtual reality simulation for a CAVE environment.

View source on GitHub →

A browser-based simulation of a CAVE (Cave Automatic Virtual Environment). The simulation computes, for a given head/eye position, the correct off-axis (asymmetric) perspective projection needed to render the 3D scene onto each wall so it looks geometrically consistent from that viewpoint (same principle real CAVE systems use).

Overview

Controls

Key Action
Drag Move the head or any object in the scene
L / R Snap the free camera to the left / right eye position
S Toggle the main scene on/off
W Toggle frustum debug visualization
Q / E Toggle left / right eye frustum
1 2 3 4 Toggle front / left / right / floor frustum
Increase / decrease near plane (zNear)
Increase / decrease far plane (zFar)
T / P Log view / projection matrices to the console

Screenshots

Frustum debug (W): theoretical frustum lines for one or both eyes (configurable) drawn from the head towards the walls, showing how the off-axis frustum skews with head position.

Frustum debug view

Movable objects: every object in the scene can be moved around, so you can see how each one affects the projection.

Moving the head and objects around the scene

How it works

Notes

Requires WebGL. The VR button will report “VR not supported” on a regular desktop browser (this is expected).

Made for the Virtual and Augmented Reality course (MIRI, Facultat d’Informàtica de Barcelona, UPC).