Wormhole Simulator
A simple ray-tracing simulation of a wormhole between two regions of space.
Controls
- Use WASD to move forward/backward/left/right
- Use shift to move up, Control to move down
- Press escape or space to bring up or close the menu
If the mouse isn't captured properly in full-screen (i.e. you can still see the mouse), try pressing space to open the settings menu and then close it again.
Options (and what they mean)
Throat length and curvature radius control the size of the wormhole (see below for more details on exactly what these mean.
There are several options for the textures to be used around the wormhole, which can be moved through in the menu.
"Only look around while clicking" - when active, mouse movements will only move the camera while the left mouse button is clicked. (This is intended to help when used in browser and the mouse isn't captured)
What on Earth is Going on Here?
This simulation works by a custom implementation of ray tracing in four dimensions - the space you move around in is 3d, but embedded in four dimensions.
To have any hope of thinking about that, try instead thinking about how this would work in one less dimension - you are a flat, 2d creature living on a 2d surface. To make a wormhole, we need this flat 2d surface to secretly be living in three dimensions so that we can curve the surface - the diagram shows what's happening here.
(If you want a better diagram, I can't help you)
On the diagram, the distance labelled t is the throat length, and the distance labelled r is the curvature radius.
To move to three dimensional space, it turns out to be a very easy change in the algebra, but then impossible to think about.
Better explanation, attempt at a diagram, and source code are available upon request (but the code might not be very helpful for other projects because it only works in a custom-written ray-tracing environment, not - say - an actual game engine environment that someone might actually want to work in)
Credits etc.
All code written by me
Some assets by Screaming Brain Studios
Created in Godot
Status | Released |
Platforms | HTML5, Windows, macOS, Linux |
Rating | Rated 5.0 out of 5 stars (1 total ratings) |
Author | TheJackOfClubs |
Genre | Simulation |
Tags | 3D, Godot, Physics, Sci-fi, Space, Visualization, wormhole |
Download
Install instructions
Unzip and run!
Comments
Log in with itch.io to leave a comment.
Hey! First of all thanks for making and sharing this impressive raytracer. Would you be able to share the source code? I'm curious on how you're linking two points in space through a 4th space, whether or not you are using curved space, and if each raycast is continuous or if a ray is re-run for each side of the wormhole. Cheers!
Hi, thanks for the comment! I've made the Godot project - including source code - publicly available at https://github.com/LawrenceHollom/Wormhole.
The entire simulation runs using a home-brew Vector4 implementation, and all the visuals are done with a single shader. So it really is a single space, just living in four dimensions - it uses ray marching in the full four dimensional space, through the wormhole, and out the other side.
I hope this helps!