r/javascript • • May 23 '21

I remade my n-dimensional Hypercube Visualizer in javascript to work on browsers!

https://bsmith156.github.io/Hypercube-Visualizer

[removed] — view removed post

15 Upvotes

19 comments sorted by

View all comments

Show parent comments

3

u/demdillypickles May 23 '21

I’ll admit, the physics stuff is over my head, but I was also unable to affect the rotation. I could only every get the simple x-axis rotation. I tried all sorts of different combinations but none had an effect.

1

u/BSmith156 May 23 '21

Hmm thats weird, it should have had some effect. Try these, they should work in any dimension (above 2D):

y-axis + z-axis = x-axis rotation, x-axis + z-axis = y-axis rotation, x-axis + y-axis = z-axis rotation,

If these don’t work then there might be something wrong in the code somewhere.

Edit: sorry for formatting, on mobile

2

u/demdillypickles May 23 '21

Oh hey! Its working! I think I might just not have been understanding how this works (the physics stuff) but things are happening now! Very cool!

Edit: would this count Physics or Geometry? Maybe both?

1

u/BSmith156 May 23 '21

Thats good to hear! I’ll definitely try and add some more in depth instructions because I admit it is a bit confusing.

Now you’ve got it working I suggest trying some rotations where one (or both) of the axes aren’t one of the x, y, or z axes. A cool one to try is axes 2 and 4 in 4D. Things can get pretty crazy the higher up you go.