Giter Club home page Giter Club logo

nd-raytracer's Introduction

N-Dimensional Raytracer

A raytracing rendering engine that supports rendering hyper-spheres and hyper-cubes in higher dimensions. Currently available are the dimensions 2 to 9 but higher dimensions would be theoretically possible. It just gets very computationally expensive.

All objects are projected into the 2D plane that is the camera screen. So pretty much what we are used to from 3D space. You can imagine the process of projecting 4D space onto a 2D screen like taking a 1D "line scan" (think barcode scanner not laser pointer) of 3D space.

demo

Getting Started

There is a convenient web frontend that you can visit at nd-raytracing.netlify.app

Implementation

The rendering engine is implemented in Rust using a generic vector type. This allows us to use a fixed size (stack allocatable) struct while still having the ability to render arbitrary dimensions. We just need to let the compiler generate the code for each of our N-D renderers.

The web frontend is simply using a WebAssembly build and a WebWorkers to spread the computation over the available cores.

The canvas 2D API is used to put the pixels on the screen. The canvas is dynamically scaled to ensure a reasonable frame rate.

This builds on my previous work: N-Dimensional Raytracing in JavaScript

nd-raytracer's People

Contributors

moritzkn avatar

Stargazers

 avatar Pierce Brooks avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.