A higher dimensional raytracing prototype with non-euclidean-like features

Related tags

Graphics euclider
Overview

euclider

Build Status Build status

A higher-dimensional "non-euclidean" ray tracing prototype written in Rust.

Dual-licensed under MIT or the UNLICENSE.

Installation

  1. Install the Rust language via Rustup
  2. Use nightly rust via rustup default nightly
  3. Clone this repository and cd into it
  4. Build with cargo build --release
  5. Run with target/release/euclider
  6. Open a scene with target/release/euclider --scene scenes/3d_room.json

Controls

  • Mouse wheel - resolution adjustment
  • [Esc] - exit

3D Scenes

  • Mouse - camera rotation
  • [W/A/S/D/Shift/Control] - camera movement

4D Scenes

  • Generalized rotations happen in a plane, not around an axis. A plane is given by two axes of the camera. Rotate by holding two buttons bound to the following axes and pressing [C/M]:
    • [I] - x axis
    • [O] - Y axis
    • [K] - Z axis
    • [L] - W axis
  • [W/A/S/D/Shift/Control/Q/E] - camera movement

Preview

Fresnel Sphere A simple sphere displaying Fresnel equations.

3D Room A scene containing a room with several entities. Listed from left to right:

  • a blue sphere with a partially reflective surface;
  • a cuboid with an animated perlin noise surface;
  • a glass material in the shape of the complement set operation on a cube and a sphere;
  • an infinite cylinder passing through the ceiling and the floor

3D Hallways A non-euclidean 3D scene consisting of hallways that either stretch the space inside (left) or shrink it (right).

4D Cylindric Hypercube Frame A frame of a 4D hypercube made of cylinders as edges. Notice how the rays on the cyan cylinder in the bottom right are reflected to the fourth dimension, revealing more of the frame.

Comments
  • Broken on nightly

    Broken on nightly

    I saw this thread on reddit and decided to give the crate a try. Unfortunately it does not compile on recent nightlies (I tried with one from three days ago and today).

    error[E0277]: the trait bound `*mut std::ops::FnMut(glium::<unnamed>::Event) + 'static: std::marker::Send` is not satisfied in `std::option::Option<*mut std::ops::FnMut(glium::<unnamed>::Event) + 'static>`
       --> src/universe/mod.rs:316:23
        |
    316 |                 scope.execute(move || {
        |                       ^^^^^^^ `*mut std::ops::FnMut(glium::<unnamed>::Event) + 'static` cannot be sent between threads safely
        |
        = help: within `std::option::Option<*mut std::ops::FnMut(glium::<unnamed>::Event) + 'static>`, the trait `std::marker::Send` is not implemented for `*mut std::ops::FnMut(glium::<unnamed>::Event) + 'static`
        = note: required because it appears within the type `std::option::Option<*mut std::ops::FnMut(glium::<unnamed>::Event) + 'static>`
        = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Mutex<std::option::Option<*mut std::ops::FnMut(glium::<unnamed>::Event) + 'static>>`
        = note: required because it appears within the type `winit::platform::platform::events_loop::UserCallback`
        = note: required because it appears within the type `winit::platform::platform::events_loop::Shared`
        = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Arc<winit::platform::platform::events_loop::Shared>`
        = note: required because it appears within the type `winit::platform::platform::events_loop::EventsLoop`
        = note: required because it appears within the type `glium::<unnamed>::EventsLoop`
        = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Mutex<glium::<unnamed>::EventsLoop>`
        = note: required because of the requirements on the impl of `std::marker::Sync` for `std::sync::Arc<std::sync::Mutex<glium::<unnamed>::EventsLoop>>`
        = note: required because it appears within the type `std::option::Option<std::sync::Arc<std::sync::Mutex<glium::<unnamed>::EventsLoop>>>`
        = note: required because it appears within the type `simulation::SimulationContext`
        = note: required because of the requirements on the impl of `std::marker::Send` for `&simulation::SimulationContext`
        = note: required because it appears within the type `[closure@src/universe/mod.rs:316:31: 345:18 index:usize, buffer_width:u32, context:&simulation::SimulationContext, buffer_width_half:u32, buffer_height_half:u32, self:&Self, time:&std::time::Duration, max_depth:u32, buffer_height:u32, chunk:&mut [u8]]`
    
    error: aborting due to previous error
    
    For more information about this error, try `rustc --explain E0277`.
    error: Could not compile `euclider`.
    
    opened by JustAPerson 7
  • Improve scene deserialization

    Improve scene deserialization

    It's kind of unwieldy having to write all the deserializers manually in one place. Maybe make macros that create the deserializers automatically? Mainly, it the deserializers shouldn't all be declared in the scene.rs file, but rather in files the struct resides in. If a good solution is found, maybe I could even externalize the code into a crate library.

    opened by Limeth 1
  • could not compile `winit` due to 3 previous errors

    could not compile `winit` due to 3 previous errors

    I have changed the Cargo.toml file to

    [package]
    edition = "2021"
    

    after running

    cargo build --release

    only a few errors occur:

    error[E0432]: unresolved import `winapi::shared::winerror`
      --> C:\Users\XX\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.16.2\src\platform\windows\dpi.rs:15:21
       |
    15 | use winapi::shared::winerror::S_OK;
       |                     ^^^^^^^^ could not find `winerror` in `shared`
    
    error[E0432]: unresolved import `winapi::um::errhandlingapi`
     --> C:\Users\XX\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.16.2\src\platform\windows\util.rs:7:17
      |
    7 | use winapi::um::errhandlingapi::GetLastError;
      |                 ^^^^^^^^^^^^^^ could not find `errhandlingapi` in `um`
    
    error[E0432]: unresolved import `winapi::shared::winerror`
        --> C:\Users\XX\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.16.2\src\platform\windows\window.rs:1153:33
         |
    1153 |             use winapi::shared::winerror::S_OK;
         |                                 ^^^^^^^^ could not find `winerror` in `shared`
    
    For more information about this error, try `rustc --explain E0432`.
    error: could not compile `winit` due to 3 previous errors
    warning: build failed, waiting for other jobs to finish...
    

    Output of

    rustc --explain E0432

    An import was unresolved.
    
    Erroneous code example:
    
    use something::Foo; // error: unresolved import `something::Foo`.
    
    In Rust 2015, paths in `use` statements are relative to the crate root. To
    import items relative to the current and parent modules, use the `self::` and
    `super::` prefixes, respectively.
    
    In Rust 2018 or later, paths in `use` statements are relative to the current
    module unless they begin with the name of a crate or a literal `crate::`, in
    which case they start from the crate root. As in Rust 2015 code, the `self::`
    and `super::` prefixes refer to the current and parent modules respectively.
    
    Also verify that you didn't misspell the import name and that the import exists
    in the module from where you tried to import it. Example:
    
    use self::something::Foo; // Ok.
    
    mod something {
        pub struct Foo;
    }
    
    If you tried to use a module from an external crate and are using Rust 2015,
    you may have missed the `extern crate` declaration (which is usually placed in
    the crate root):
    
    extern crate core; // Required to use the `core` crate in Rust 2015.
    
    use core::any;
    
    Since Rust 2018 the `extern crate` declaration is not required and
    you can instead just `use` it:
    
    use core::any; // No extern crate required in Rust 2018.
    
    opened by Sanookmakmak 0
  • Just found this repo, appears to no longer compile.

    Just found this repo, appears to no longer compile.

    Reproduce:

    • Have latest rustup installed with the nightly toolchain.
    • Clone the repo
    • cagro +nightly run --release
    • 35 errors found, mostly missing macros.
    • 1000+ warnings found, mostly deprecated conventions e.g. the try! macro.
    opened by arduano 0
  • `GeneralIntersector` returns a `Box`ed type

    `GeneralIntersector` returns a `Box`ed type

    GeneralIntersector returns a Boxed type. Since these functions can be called several thousand times per frame, it may be worth considering an alternative that doesn't require heap allocation.

    https://github.com/Limeth/euclider/blob/master/src/universe/entity/shape.rs#L35-L40

    opened by Limeth 0
Releases(v1.0.0)
Owner
Jakub Hlusička
Creating free and open source software! He/Him, They/Them.
Jakub Hlusička
SelfOrgMap 5 Nov 4, 2020
Vulkan rendering sandbox for raytracing

sol-rs ☀ sol-rs is a small rendering toolkit for Vulkan, with a focus on real-time raytracing (which is not currently available via other APIs such as

Éric Renaud-Houde 65 Dec 7, 2022
The study of a simple path tracer implementation (image raytracing in shorts)

The study of a simple path tracer implementation (generate a raytraced image, in shorts).

Leonardo Vieira 1 Apr 2, 2022
A real-time raytracing engine, with extra Bevy integration

strolle Strolle (from strålspårning) is a real-time raytracing engine written entirely in Rust, running on CPU & GPU: It comes integrated with Bevy, b

Patryk Wychowaniec 72 Jan 1, 2023
Rust library for regular expressions using "fancy" features like look-around and backreferences

fancy-regex A Rust library for compiling and matching regular expressions. It uses a hybrid regex implementation designed to support a relatively rich

fancy-regex 302 Jan 3, 2023
ndarray: an N-dimensional array with array views, multidimensional slicing, and efficient operations

ndarray The ndarray crate provides an n-dimensional container for general elements and for numerics. Please read the API documentation on docs.rs or t

null 2.6k Jan 7, 2023
K-dimensional tree in Rust for fast geospatial indexing and lookup

kdtree K-dimensional tree in Rust for fast geospatial indexing and nearest neighbors lookup Crate Documentation Usage Benchmark License Usage Add kdtr

Rui Hu 152 Jan 2, 2023
K-dimensional tree in Rust for fast geospatial indexing and lookup

kdtree K-dimensional tree in Rust for fast geospatial indexing and nearest neighbors lookup Crate Documentation Usage Benchmark License Usage Add kdtr

Rui Hu 154 Jan 4, 2023
Pool is a befunge inspired, two-dimensional esolang

Pool is a befunge inspired, two-dimensional esolang

null 1 Nov 1, 2021
2 and 3-dimensional collision detection library in Rust.

2D Documentation | 3D Documentation | User Guide | Forum ⚠️ **This crate is now passively-maintained. It is being superseded by the Parry project.** ⚠

dimforge 914 Dec 24, 2022
2 and 3-dimensional rigid body physics engine for Rust.

Users guide | 2D Documentation | 3D Documentation | Forum ⚠️ **This crate is now passively-maintained. It is being superseded by the Rapier project.**

dimforge 1.6k Jan 6, 2023
k-dimensional tree

kd-tree k-dimensional tree in Rust. Fast, simple, and easy to use. Usage // construct kd-tree let kdtree = kd_tree::KdTree::build_by_ordered_float(vec

Terada Yuichiro 32 Dec 2, 2022
a super fast scientific calculator with dimensional analysis support written in Rust 🦀

larvae a super fast scientific calculator with dimensional analysis support written in Rust ?? ?? heavily inspired from insect Usage: Command mode: $

John McAvoy 2 Jan 10, 2022
Rust implementations of Fast Fourier Transform convolution and correlation for n-dimensional arrays

fftconvolve Rust implementations of Fast Fourier Transform convolution and correlation for n-dimensional arrays Examples 1-dimensional use fftconvolve

Rhys Newell 33 Jan 5, 2023
`N` dimensional cubic chunks crate

Hypercube Todo create OffsetShape<S: Shape, const D: usize> a Shape offset by some amount Api positions(self) -> OffsetPositions<Self> create OffsetPo

null 3 Jan 15, 2023
Serde support for n-dimensional arrays from self-describing formats

serde-ndim Overview This crate provides a way to serialize and deserialize arrays of arbitrary dimensionality from self-described formats such as JSON

Ingvar Stepanyan 5 Apr 3, 2023
Source code for our paper "Higher-order finite elements for embedded simulation"

Higher-order Finite Elements for Embedded Simulation This repository contains the source code used to produce the results for our paper: Longva, A., L

Interactive Computer Graphics 18 Sep 30, 2022
Wrapper around atspi-code to provide higher-level at-spi Rust bindings

atspi Wrapper around atspi-codegen to provide higher-level at-spi Rust bindings. Contributions Take a look at our atspi-codegen crate, and try inpleme

Odilia 3 Feb 7, 2022
Didactic implementation of the type checker described in "Complete and Easy Bidirectional Typechecking for Higher-Rank Polymorphism" written in OCaml

bidi-higher-rank-poly Didactic implementation of the type checker described in "Complete and Easy Bidirectional Typechecking for Higher-Rank Polymorph

Søren Nørbæk 23 Oct 18, 2022
Implementation of "Complete and Easy Bidirectional Typechecking for Higher-Rank Polymorphism"

Implementation of "Complete and Easy Bidirectional Typechecking for Higher-Rank Polymorphism" See arXiv:1306.6032 This implementation focusses on read

Jakob Demler 95 Dec 20, 2022