Skip to content
Sign upLog in
← Back to Community

any dimensional cube

Profile icon
benji10

The program will create a cube in any dimensions and display it. repl.it will only allow up to 5 dimensions though. Press "p" to toggle perspective which could change the whole view. Press "space" to only show verticies. My second repl. Have fun!

Voters
Profile icon
DaCoderOf2022
Profile icon
EhsanullahHessa
Profile icon
CPPCodeBlock
Profile icon
xxpertHacker
Profile icon
BobTheTomatoPie
Profile icon
ARJPEG
Profile icon
JonathanBrazier
Profile icon
JosiahKnisely
Profile icon
MalMal357
Profile icon
python9160
Comments
hotnewtop
Profile icon
CodingCactus

awwww, it doesn't work with 1 dimension :(

Profile icon
FlynnRushtone

@CodingCactus
no, it kind of just crashes.

Profile icon
CodingCactus

how can you have 5 dimensions, that doesn't make sense?

Profile icon
benji10

@CodingCactus
it's just visualising what a 5D cube would look like.

Profile icon
CodingCactus

@benji10
ok, I'm just confused by how you could have a 5D object, could you explain it to me? :)

Profile icon
benji10

@CodingCactus
i'm pretty sure this is all theoretical. But this is visualising what it would look like. I can't really explain, so i think the best bet is to look it up online.

Profile icon
CodingCactus
Profile icon
benji10
Profile icon
xxpertHacker

@CodingCactus
There's an infinite number of dimensions. Now this is gonna sound crazy, but here I go.

You know how you can look at a 2D image and see everything at once? If I made a 2D box you'd be able to see all sides, inside and outside? Well that's because you're one dimension higher than 2D.

Do you know what that means?

A 4D being can see inside and outside of a 3D cube at the same time. Contemplate that for a bit. You should understand what that means for 5D then.

We, as 3D beings, aren't intended to conceptualize higher dimensions, but some can with relative easy, while others struggle.

Profile icon
CodingCactus

@StudentFires
i'm confused what else there could be, other than height, width and depth?

Profile icon
xxpertHacker

@CodingCactus
It gets very complicated. I believe that time is considered to be the 4th dimension.

Profile icon
xxpertHacker

Aww, I wanted to finally see a 1 dimensional object. ahh whatever, definitely worth the upvote! Good work!

Profile icon
benji10
Profile icon
CodingCactus

@StudentFires
a 1d object is just a length (i.e. a line)

Profile icon
xxpertHacker

@CodingCactus
Nope, a line is 2D. That is what I can't get about 1D. There can't be 1D objects. 1D is more of a concept.

Profile icon
CodingCactus

@StudentFires
no, 1d is one dimension like height is 1d
i believe

Profile icon
xxpertHacker

@CodingCactus
Yeah, but lines are 2D.

Profile icon
xxpertHacker

@CodingCactus
Is height an object?

Profile icon
CodingCactus

@StudentFires

image

Profile icon
CodingCactus

@StudentFires

image

Profile icon
xxpertHacker

@CodingCactus
Lies, the 1D line is still 2D, we can measure the width of it. It's width needs to be 0 or NaN, then it would be 1D, but also unseeable.

That 0 is totally incorrect.

Profile icon
xxpertHacker

@CodingCactus
That is how it is in mathematics, but math is just a human constructed conceptual system that can be used to assist us with physical, natural objects.

Those are the conceptual dimensions.

Profile icon
CodingCactus

@StudentFires
ik about the 0, it's just a picture off the internet, but I think of 1d like one of the edges of your garden or something?

Profile icon
xxpertHacker

@CodingCactus
Here's the thing, look at this character:

|

It is a line, right? Of course it is!

But... we can measure it's width, thus it is a thin rectangle, thus 2D.

Profile icon
CodingCactus

@StudentFires
yes, but what is the width of one of the lengths of your garden?

Profile icon
xxpertHacker

@CodingCactus
Well, I don't have a garden, but a normal 2D object's length can be measured, it is an attribute of the object (garden), but it cannot exist on it's own. It is a real thing though.

Thus we wouldn't be able to see it.

Profile icon
CodingCactus

@StudentFires

image

Profile icon
xxpertHacker

@CodingCactus
Like I said, stuff gets complicated fast.

Profile icon
CodingCactus

I give up. Some of my brain just fell out of my ear, so i'm going to stop now.

@StudentFires

Profile icon
xxpertHacker

@CodingCactus
To a being of the dimension, eg: square 2D being, or 3D being, cude, the object would appear totally normal to the being. As we are 3D beings, everything <= 3D is "normal" for us. We aren't supposed to perceive objects of 0D < nD > 3D .

Profile icon
xxpertHacker
Profile icon
benji10

@CodingCactus
good that my 5D cube looks like that one! I didn't actually know what a 5D cube would look like.

Profile icon
xxpertHacker

@benji10
I don't blame you, it's not every day you look at 4D+ objects, is it?

Profile icon
benji10

@StudentFires
No, it's not.

Profile icon
CodingGoose

The 4D cube makes my brain hurt. Love the animation!

Profile icon
benji10
Profile icon
JonathanBrazier

How did you detect when p was pressed?

Profile icon
benji10

@JonathanBrazier
You use keyboard bindings. For Turtle, you can say
wn.listen()
onkey(function, "p")

or

wn.listen()
onkeypress(function, "p")

if it's a later version of python.

Profile icon
JonathanBrazier

@benji10
thx :D

Profile icon
benji10

@JonathanBrazier
There's also a bunch of screen events you can use here: https://docs.python.org/3.1/library/turtle.html#turtle.listen

Profile icon
JosiahKnisely

My mind just broke by looking at a 10d cube.

Profile icon
benji10

@JosiahKnisely
wait, you can see a 10D cube?!

Profile icon
benji10

@JosiahKnisely
I thought repl.it couldn't handle more than 5

Profile icon
CodingCactus

@benji10
it can't

Profile icon
JosiahKnisely

@CodingCactus
It was just off the internet, not from Repl.it.

Profile icon
JosiahKnisely

600px-10-cube.svg

Profile icon
JosiahKnisely

Ahhh, so MIND BLOWING!

Profile icon
benji10
Profile icon
JosiahKnisely

@benji10
It's not even a cube any more.

Profile icon
benji10

@JosiahKnisely
Nope, it's literally a circle at this point.

Profile icon
benji10

@JosiahKnisely
I've also made an updated version of this. It's in JavaScript so runs much faster (up to 15 ish dimensions depending on your computer). Here it is:
https://wallpaper.benji10.repl.co/
Double and triple click to raise / lower dimension.

Profile icon
JosiahKnisely

Bruh so cool!

Profile icon
benji10
Profile icon
JosiahKnisely

@benji10
No problem.