Skip to content

NathanS-Git/Hypercube-Renderer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hypercube renderer

This renders an n-dimensional hypercube and rotates it about all of its planes of rotations. Written in Rust and is <100 lines of code.

Examples

A simple 3D cube perspective projected.

A wireframe cube rotating

4D Hypercube (Tesseract) Perspective projected

4D hypercube rotating about all of its axes

4D Hypercube (Tesseract) Orthographically projected

4D hypercube rotating about all of its axes

5D Hypercube (Penteract) Perspective projected

5D hypercube rotating about all of its axes

6D Hypercube (Hexeract) Perspective projected

6D hypercube rotating about all of its axes

And last but not least, just for some fun, a rendering of a 10D Hypercube (in perspective projection).

10D hypercube rotating about all of its axes

Dependencies

  • nannou
  • ndarray
  • lazy_static

Build and run

Prerequisites

  • Install the Rust toolchain (the latest stable version is usually fine).

Running the renderer

  1. Clone this repository and change into its directory:
    git clone <repository-url>
    cd Hypercube-Renderer
  2. Build and run the project with Cargo:
    cargo run
    This will compile the renderer and open a window showing a rotating 4D tesseract.

Changing the dimension

The dimension of the hypercube is controlled by the DIM constant at the top of src/main.rs. Edit that value and run cargo run again to render a cube (3), penteract (5), hexeract (6), or any other dimension you would like to visualize.

About

Capable of rendering any n-dimensional hypercube.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages