# N Dimensions

ND <-------------------

This is my N dimensional Cube / Square thing I have been working on.

I have already done a cube and sphere environment with raytracing but I was wondering If anyone has done some N Dimensional raycastings as that would be a cool project but my head is on fire due to the maths involved

Any Ideas?

Change Dimensions counter at top of code for different dimensions.

10 Likes

How do people make these!?

5 Likes

It builds the points from n d vectors using a n d cube function and creates an n d rotation matrix.

I could explain all of it.

Tell me If you get any ideas.

5 Likes

Neat! I modified it a bit to add a perspective transform, hereâ€™s the 4D version of that:

9 Likes

I used to have something like that but thought it was better at exactly 100 lines :).

Also try adding a trail to a random point and watching where it goesâ€¦ Pretty interesting :).

4 Likes

My head hurts from watching it.

4 Likes

Same here @UnsignedArduino. I think I lost some brain cells just from watching that 4D rotation thing for an hour. Itâ€™s really cool thoughâ€¦ zzzzzzzz

4 Likes

A suggestion - it seems that the rotation is repeating and not showing all the mind-bending possible variations. Can you try using separate rotation speeds for the various axes so that they rotate more independently?

4 Likes

Yes you can just change the rotation rate at the bottom, the reason it repeats is because all rotation amounts are equal.

You can even hook the up to buttons to get a feel for it

Also Have you noticed how the circle function seems to make a kind of helmet shape ?

3 Likes

This was my original

all buttons including menu

4 Likes

Thought You might find this interesting:

See the similarities between even and odd dimensions?
Pretty cool
9 Likes

terseract, right?

3 Likes

Yes, a Tesseract is the four-dimensional version of a cube: https://en.wikipedia.org/wiki/Tesseract

Image credit: By Jason Hise - Own work, Public Domain, https://commons.wikimedia.org/w/index.php?curid=1702289

3 Likes

Thatâ€™s how that cube makes me feel @kwx