Skip to content

jkcuk/Einstagram

Repository files navigation

Einstagram

by Gordon Wells, YiChen Wu, Maik Locher, and Johannes Courtial, with thanks to Richard Bowman
School of Physics & Astronomy, University of Glasgow

Web app: https://jkcuk.github.io/Einstagram/

Interactive simulation of the relativistic distortion using the lookalike-sphere construction.

The relativistic distortion is the change in direction in which objects in motion relative to the observer are seen. The wavelength shift associated with the (relativistic) Doppler effect and the change in intensity due to the headlight effect are not simulated.

β = (βx, βy, βz) is the simulated velocity of the viewer, in units of c (the speed of light), relative to the scene, which is assumed to be at rest. The (left-handed) coordinate system is defined such that x points to the right, y upwards, and z into the screen.

The lookalike-sphere construction projects the view onto a sphere that is centred on the observer and then distorts and translates this sphere such that the view from the centre of the undistorted and undisplaced sphere becomes the relativistically distorted view. The distorted lookalike sphere can be visualised by setting "Camera position" to "Outside lookalike sphere". To help with orientation, the part of the forward-facing hemisphere of the lookalike sphere surrounding the environment-facing camera image is coloured white (like bicycle headlights), the rear-facing hemisphere surrounding the user-facing camera image is coloured red (like rear lights).

Screenshot_20240306-161205 Lookalike sphere. The image projected into the centre of the white hemisphere is a frame from the video feed from the device's environment-facing camera, ...

Screenshot_20240306-161220 ... the image projected into the centre of the red hemisphere is from the user-facing camera's video feed.

Screenshot_20240306-161256 From the centre of the lookalike sphere, and looking in the direction of the white hemisphere, the inside of the lookalike sphere looks like the undistorted video feed from the environment-facing camera. The video feed from the user-facing camera can be seen in the opposite direction (not shown).

Screenshot_20240306-161520 Distorted lookalike sphere, seen from outside...

Screenshot_20240306-161359 ... and from inside. This is the relativistically distorted view for a camera moving with velocity βc in the scene (which is assumed to be at rest).

In addition to purely relativistic effects, the relativistic distortion takes into account time-of-flight effects. The distortion due to time-of-flight effects alone can be simulated by setting "Transformation" to "Galileo"; it corresponds to a pure translation of the lookalike sphere.

A few details

For the simulation to be correct, the FOV of the (user-facing and environment-facing) device cameras must be set correctly. The value entered is the wider angle of view, in degrees.

The FOV of the screen represents the angle, in degrees, subtended by the screen from the viewer's position. Changing it effectively zooms in and out of the view without affecting the distortion.

Some devices have only a single camera, and other devices do not allow simultaneous video streaming from both cameras. The behaviour is then device- and browser-dependent.

Changelog

[Version 1.1.0] - 2024-07-31

Added

  • Added Gyroscope Mode feature, which uses gyroscope and draggable spheres to control velocity direction and magnitude.

Fixed

  • Fixed the compatibility of deviceorientation across different operating systems.
  • Fixed the compatibility of orientation.type across different operating systems.