# N Dimensions

**URL:** https://forum.makecode.com/t/n-dimensions/4172
**Category:** Show & Tell
**Tags:** graphics-and-math
**Created:** [October 29, 2020, 11:06pm UTC](https://forum.makecode.com/t/n-dimensions/4172 "2020-10-29T23:06:48Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![charliegregg](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/charliegregg/32/2411_2.png) [@charliegregg](https://forum.makecode.com/u/charliegregg)
#### Post date: [October 29, 2020, 11:06pm UTC](https://forum.makecode.com/t/n-dimensions/4172/1 "2020-10-29T23:06:48Z")

</div>

[ND](https://makecode.com/_XUsDoyf5e39c) \<-------------------

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.

---

<div class="post-metadata">

### Author: ![GameGod](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gamegod/32/2756_2.png) [@GameGod](https://forum.makecode.com/u/GameGod)
#### Post date: [October 29, 2020, 11:18pm UTC](https://forum.makecode.com/t/n-dimensions/4172/2 "2020-10-29T23:18:12Z")

</div>

How do people make these!?

---

<div class="post-metadata">

### Author: ![charliegregg](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/charliegregg/32/2411_2.png) [@charliegregg](https://forum.makecode.com/u/charliegregg)
#### Post date: [October 29, 2020, 11:20pm UTC](https://forum.makecode.com/t/n-dimensions/4172/3 "2020-10-29T23:20:56Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![kwx](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kwx/32/1545_2.png) [@kwx](https://forum.makecode.com/u/kwx)
#### Post date: [October 30, 2020, 2:46am UTC](https://forum.makecode.com/t/n-dimensions/4172/4 "2020-10-30T02:46:14Z")

</div>

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

> **[ND perspective](https://arcade.makecode.com/57996-71150-63147-32584)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

### Author: ![charliegregg](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/charliegregg/32/2411_2.png) [@charliegregg](https://forum.makecode.com/u/charliegregg)
#### Post date: [October 30, 2020, 10:22am UTC](https://forum.makecode.com/t/n-dimensions/4172/5 "2020-10-30T10:22:44Z")

</div>

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 :).

---

<div class="post-metadata">

### Author: ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)
#### Post date: [October 30, 2020, 11:58am UTC](https://forum.makecode.com/t/n-dimensions/4172/6 "2020-10-30T11:58:19Z")

</div>

My head hurts from watching it. 😬

---

<div class="post-metadata">

### Author: ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)
#### Post date: [October 30, 2020, 1:17pm UTC](https://forum.makecode.com/t/n-dimensions/4172/7 "2020-10-30T13:17:18Z")

</div>

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

---

<div class="post-metadata">

### Author: ![kwx](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kwx/32/1545_2.png) [@kwx](https://forum.makecode.com/u/kwx)
#### Post date: [October 30, 2020, 5:11pm UTC](https://forum.makecode.com/t/n-dimensions/4172/8 "2020-10-30T17:11:38Z")

</div>

> [@charliegregg](#):
>
> Tell me If you get any ideas.

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?

---

<div class="post-metadata">

### Author: ![charliegregg](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/charliegregg/32/2411_2.png) [@charliegregg](https://forum.makecode.com/u/charliegregg)
#### Post date: [October 30, 2020, 11:50pm UTC](https://forum.makecode.com/t/n-dimensions/4172/9 "2020-10-30T23:50:36Z")

</div>

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 ?

---

<div class="post-metadata">

### Author: ![charliegregg](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/charliegregg/32/2411_2.png) [@charliegregg](https://forum.makecode.com/u/charliegregg)
#### Post date: [October 30, 2020, 11:54pm UTC](https://forum.makecode.com/t/n-dimensions/4172/10 "2020-10-30T23:54:46Z")

</div>

This was my original

> **[Original 4D](https://arcade.makecode.com/78498-89815-00576-81108)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

all buttons including menu

---

<div class="post-metadata">

### Author: ![charliegregg](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/charliegregg/32/2411_2.png) [@charliegregg](https://forum.makecode.com/u/charliegregg)
#### Post date: [November 1, 2020, 12:10am UTC](https://forum.makecode.com/t/n-dimensions/4172/11 "2020-11-01T00:10:00Z")

</div>

Thought You might find this interesting:

> **[ND WITH TRACE](https://arcade.makecode.com/27422-27229-76044-43747)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

  
See the similarities between even and odd dimensions?  
Pretty cool

---

<div class="post-metadata">

### Author: ![Agent\_14](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/agent_14/32/17567_2.png) [@Agent\_14](https://forum.makecode.com/u/Agent_14)
#### Post date: [February 10, 2021, 4:26pm UTC](https://forum.makecode.com/t/n-dimensions/4172/12 "2021-02-10T16:26:06Z")

</div>

terseract, right?

> [@kwx](#):
>
> Neat! I modified it a bit to add a perspective transform, here’s the 4D version of that:
> 
> ![](https://pxt.azureedge.net/blob/e9dfde3b71399a21bd1f586efa4748d0fa6775a0/static/logo.svg) [Microsoft MakeCode](https://arcade.makecode.com/57996-71150-63147-32584)
> 
> ![](https://pxt.azureedge.net/api/57996-71150-63147-32584/thumb)
> 
> ### [ND perspective](https://arcade.makecode.com/57996-71150-63147-32584)
> 
> Made with ❤ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

### Author: ![kwx](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kwx/32/1545_2.png) [@kwx](https://forum.makecode.com/u/kwx)
#### Post date: [February 10, 2021, 6:21pm UTC](https://forum.makecode.com/t/n-dimensions/4172/13 "2021-02-10T18:21:04Z")

</div>

> [@Agent\_14](#):
>
> terseract, right?

Yes, a Tesseract is the four-dimensional version of a cube: [https://en.wikipedia.org/wiki/Tesseract![8-cell|255x255](upload://38GLLGr5wvvHMcazT78EusU5wyW.gif)](https://en.wikipedia.org/wiki/Tesseract!%5B8-cell%7C255x255%5D(upload://38GLLGr5wvvHMcazT78EusU5wyW.gif))

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

---

<div class="post-metadata">

### Author: ![Primal\_Nexus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/primal_nexus/32/3540_2.png) [@Primal\_Nexus](https://forum.makecode.com/u/Primal_Nexus)
#### Post date: [February 11, 2021, 5:23pm UTC](https://forum.makecode.com/t/n-dimensions/4172/14 "2021-02-11T17:23:59Z")

</div>

🤮 🤮 🤮 🤮 🤮 🤮 🤮 🤮 🤮 🤮 🤮 🤮 🤮 🤮 🤮 🤮 🤮 🤮 🤮 🤮 🤮 🤮 🤮 🤮 That’s how that cube makes me feel @kwx
