Skip to content

A simple CPU implementation of the ray tracing engine that renders 4D images. It answers the Zhihu quesition: https://www.zhihu.com/question/19734310/answer/1755370286

Notifications You must be signed in to change notification settings

XiaoxingChen/ray_tracing_4d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ray Tracing in 4-dimensional World

This repo extends a simplest 3-dimensional ray tracing engine(CPU implementation) to 4-dimensional world.

.3D4D
Parameterization of Rotation SO3, axis-angle or quaternion SO4, bi-vector or two quaternions (Rodrigous formula doesn't hold anymore)
Camera Model
Image of a 3D object
by 3D camera, resolution: 640x480

by 4D camera, resolution: 640x480x32

4D Objects

A 4D cube frame and a 4d sphere.

Installation and Run

clone code

git clone https://github.com/XiaoxingChen/ray_tracing_4d
cd ray_tracing_4d
git submodule init
git submodule update

Download assets(wget was used, doesn't work on Windows) and render a 3D scene. If you use Windows, please download the assets in lfs.yaml and put them in build/assets/.

./build.py --sync-lfs

Render 3D, 4D scenes

./build.py --run app/render_3d
./build.py --run app/render_4d

References

  1. Miegakure
  2. python geometric algebra library
  3. scratch a pixel
  4. ray tracing in one weekend
  5. decomposition of n-d rotations
  6. block diagonalize rotation matrix

About

A simple CPU implementation of the ray tracing engine that renders 4D images. It answers the Zhihu quesition: https://www.zhihu.com/question/19734310/answer/1755370286

Topics

Resources

Stars

Watchers

Forks