This is an earnest attempt at writing a renderer for 4D geometry and physics engine for 4D objects, written for learning both wgpu-rs and 4D geometry.

GitHub - t-veor/hypervis: A silly 4D physics simulation.

submited by
Style Pass
2023-05-26 17:00:06

This is an earnest attempt at writing a renderer for 4D geometry and physics engine for 4D objects, written for learning both wgpu-rs and 4D geometry.

This project was largely motivated by seeing Marc ten Bosch's games, Miegakure (still in development at the time of writing) and 4D Toys.

While there have been many implementations of 4D visualisers, I've not come across an implementation or a good description of or even general pointers to how to implement a physics engine in 4D. 4D Toys is the only example of an actual 4D engine I could find, and it's closed-source.

(Marc ten Bosch has published a paper N-Dimensional Rigid Body Dynamics about his 4D physics engine, but by this point most of my implementation was in place and it would've been helpful to be able to refer to this earlier on...)

Hypervis implements rendering of 4D objects by only rendering a 3D slice of the 4D space to the user. The X, Y, and Z-axes have their conventional meanings, but in addition to these the user manually controls which W-axis slice is rendered via a slider. This means that we are showing incremental hyperplanar slices through the 4D space.

Leave a Comment